I am getting the error
"The model backing the 'DataContext' context has changed since the database was created. Consider using Code First Migrations to update the database".
I am using Entity Framework and have changed my model after declaring DataContext
. How can I fix this error?
If you delete the __MigrationHistory
table in SQL Server it should fix it.
I used database first to create a project after I had changed my database context
and solved my problem:
Database.SetInitializer<Models.YourDbContext>(null);
Don't forget to handle the DbUpdateException
Delete the __MigrationHistory table in SQL Server or just or all rows of this table it should fix it