This is my code:
public List<Core.Domain.ActivityDepreciationType> GetAllActivityDepreciationType()
{
using (TrenStarEAMEntities1 dbContext = new TrenStarEAMEntities1())
{
// Exception occurs here --v
var efActivityDepriciationType = dbContext.ActivityDepreciationTypes.ToList();
var config = new MapperConfiguration(cfg =>
{
cfg.CreateMap<EFModels.ActivityDepreciationType, Core.Domain.ActivityDepreciationType>();
});
var mapper = config.CreateMapper();
return mapper.Map<List<Core.Domain.ActivityDepreciationType>>(efActivityDepriciationType);
}
}
My task is to scaffold tables in a database in MVC.
Error occurs at line:
var efActivityDepriciationType = dbContext.ActivityDepreciationTypes.ToList();
This is what the error says:
System.Data.Entity.Core.MetadataException occurred Message=Unable to load the specified metadata resource. Source= StackTrace: