Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 226
user3004110 Avatar asked Nov 27 '13 04:11

user3004110


1 Answers

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);
like image 139
Olav Nybø Avatar answered Nov 15 '22 07:11

Olav Nybø