The model backing the \'MyDbContext\' context has changed since the database was created. Consider using Code First Migrations to update the database (http://
This happens when your table structure and model class no longer in sync. You need to update the table structure according to the model class or vice versa -- this is when your data is important and must not be deleted. If your data structure has changed and the data isn't important to you, you can use the DropCreateDatabaseIfModelChanges
feature (formerly known as 'RecreateDatabaseIfModelChanges
' feature) by adding the following code in your Global.asax.cs:
Database.SetInitializer(new DropCreateDatabaseIfModelChanges());
Run your application again.
As the name implies, this will drop your database and recreate according to your latest model class (or classes) -- provided you believe the table structure definitions in your model classes are the most current and latest; otherwise change the property definitions of your model classes instead.