错误提示:
The model backing the 'xyzContext' context has changed since the database was created. Either manually delete/update the database, or call Database.SetInitializer with an IDatabaseInitializer instance. For example, the RecreateDatabaseIfModelChanges strategy will automatically delete and recreate the database, and optionally seed it with new data.
解决办法:
This is a bug in CTP4 for using EF with pre-existing databases.
You can fix it by calling:
Database.SetInitializer<YourContext>(null);
in the Application_Start method of Global.asa
本文介绍了解决Entity Framework中因模型变更导致的应用错误问题。针对使用预存数据库时出现的特定错误,提供了一种简单的解决方案:通过在Global.asax文件的Application_Start方法中调用Database.SetInitializer方法来修复。

被折叠的 条评论
为什么被折叠?



