Wednesday, February 25, 2015

Updating Database model with C# code first

The error:
The model backing the '(data context name)' 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: Add this line of code into the Global.asax.cs -> Application_Start() method
Database.SetInitializer<(model name)>(null);

No comments: