EF错误

The model backing the 'XXXXDBContext' 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 DropCreateDatabaseIfModelChanges strategy will automatically delete and recreate the database, and optionally seed it with new data.

  出现上述错误需要在Global.asax中的Application_Start方法中加入:

Database.SetInitializer<Models.XXXXDBContext>(null);

posted @ 2013-12-05 12:52  AaronYu  阅读(299)  评论(0编辑  收藏  举报