Reputation: 143
We have recently upgraded our Visual Studio from 2010 to 2013. With it came EF 6.0, which is incompatible with the code generated from EF 4.
I need to update a table in the model with the latest version from the DB schema. When doing that, both "Update" and "Add" after deletion of the table definition do the following:
We are not using NuGet, but referencing the EF library inside the project.
I guess VS 2013 uses a different version of the code generator than VS 2010. How can we revert to the old behavior?
UPDATE: I have tried using NuGet to download EF 4.3.1 and repeat the update model steps (also delete and then recreate), but I am still seeing the old behavior. I think there is a problem with the VS 2013 EF Code Generator.
Upvotes: 10
Views: 8987
Reputation: 6371
For me, the following solution worked.
Double-click on your edmx file and open its properties window. Change Code Generation Strategy
from T4
to Legacy Object Context
. Build your solution. It may cause thousands of errors because you have redeclared functions and properties, so remove all files that weren't there before.
Upvotes: 16