The code first methodology is new to me.
This error is occurring for me:
"Since the database's creation, the model that supports the "DataContext" context has changed. Consider updating the database using Code First Migrations ".
I'm running a WPF application utilizing EF6 and MVVM against a local database (.mdf life).
I introduced a new DbSet collection called langauges to my datacontext after creating a new model called langauges.
I receive the aforementioned issue when the code tries to instantiate a datacontext object.
What am I overlooking? For all of my other new tables and models, I simply had to write the code to create them, use a test method to add a record to the new table or model, and then run EF code first to have it create the new table and add the record without any issues. Why is it failing right now?
EF6 code initially does not by default recreate your database. That is what the exemption states. It also includes the answer to your dilemma. Use Code First Migrations, please.
Type the following into the PackageManager Console after opening it.
More details are available at MSDN.