Upgrade from Entity Framework 5 to 6

后端 未结 4 2057
轻奢々
轻奢々 2020-12-04 08:42

After upgrading our project from using Entity Framework 5 to Entity Framework 6 (though NuGets update function) i get the following error on my generated Entities class:

4条回答
  •  佛祖请我去吃肉
    2020-12-04 09:25

    I think your problem is, that your T4 templates, which generate the entitties and the context are still in EF version 5.

    First you have to delete the current code generation items, which are in the code behind of the model, namely .Context.tt and .tt.Next add a new EF version 6 code generator with Right click in the model designer-> Add Code Generation Item ... -> EF 6.x DbContext Generator.

提交回复
热议问题