After using the code
Public class MusicStoreEntities: DbContext
{
Protected override void OnModelCreating (DbModelBuilder modelBuilder)
{
ModelBuilder. Conventions. Remove <PluralizingTableNameConvention> ();
}
.....}
Problem:
The model backing the 'musicstoreentities 'context has changed since the database was created. Consider using Code First Migrations to update the database (http://go.microsoft.com/fwlink? LinkId = 238269 ).
Solution 1:
Add the following to Global. asax. cs:
Public class MvcApplication: System. Web. HttpApplication
{
Protected void Application_Start ()
{
System. Data. Entity. Database. SetInitializer <Mvc4MusicStore. Models. MusicStoreEntities> (null );
AreaRegistration. RegisterAllAreas ();
WebApiConfig. Register (GlobalConfiguration. Configuration );
FilterConfig. RegisterGlobalFilters (GlobalFilters. Filters );
RouteConfig. RegisterRoutes (RouteTable. Routes );
}
}