We created a web application using the model first approach. A new developer came into the project and created a new custom model using the code first approach (using a database file). The
Here is the code first database context.
namespace WVITDB.DAL
{
public class DashboardContext : DbContext
{
public DbSet<CTOReview> CTOReviews { get; set; }
public DbSet<Concept> Concepts { get; set; }
//public DashboardContext()
// : base("name=DashboardContext")
//{
//}
// protected override void OnModelCreating(DbModelBuilder modelBuilder)
// {
// //modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();
// }
}
}
The following controller method throws an error Could not find the conceptual model type for 'WVITDB.Models.FavoriteProject'.
and refers to the original database model. We are not sure why (or how) it is calling that.
public ViewResult Index()
{
var d = db.Concepts.ToList(); //Throws error here
return View("Index",d);
}
When the DashboardContextclass is instantiated the error are shows up for both of the DBset properties.
Is there are a reason why the controller calling the wrong database?
EDIT:
FavoriteProject is in a different context (our main data model) and not related to the new custom model.