The model backing the ‘Foo’ context has changed since the database was created

Tags: entity framework, c#, powershell, mvc

I got this error when I was playing with MVC using entity framework. Got this error when I refactor (rename) one of the class property.

The simple resolution was this:

AutomaticMigrationDataLossAllowed = True
Or you could simply run the command from powershell as follows:
Update-Database -Force

Note that you should do that only when you are playing and want a quick fix, not recommended for prod.

Add a Comment

Recent Posts