The model backing the 'POSContext' context has changed since the database was created

ぐ巨炮叔叔 提交于 2021-01-27 06:16:06

问题


I am developing winform application using entityframework in visual studio 2012 with database first approach. Suddenly I am facing the following error:-

The model backing the 'POSContext' context has changed since the database was created. Consider using Code First Migrations to update the database (http://go.microsoft.com/fwlink/?LinkId=238269).

Can any please immediately help me to resolve this issue. I shall be very thankful for timely help.

Thanks.


回答1:


make sure that you don't have a database initialized. Only have to call it once so you could put it in a static constructor of your DbContext class

Database.SetInitializer<YourDbContext>(null);


来源:https://stackoverflow.com/questions/20234246/the-model-backing-the-poscontext-context-has-changed-since-the-database-was-cr

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!