user3156499
user3156499

Reputation: 21

Difference between generate an entity data model in EF4 and EF6

Before I used EF4 to generate my entity data model from an existing database. I can do CRUD operations on every generated entity, because the entities context class with all the methods is automatically generated. Now I have upgraded my project to EF6, deleted the files created by the EF4 data model wizard and generated it again using EF6 data model wizard. Now I get a T4 template file with a context class below it, a T4 template file with for every entity a class with code, a empty designer file and an edmx diagram file. But there are no methods such as AddObject, DeleteObject, SaveChanges generated. How can they be generated as it did before with EF4?

Upvotes: 1

Views: 172

Answers (1)

LueTm
LueTm

Reputation: 2380

EF6 should still generate a context for you. It provides the mentioned methods. Are you sure you just missed in amongs all the .tt files?

EDIT: Also, make sure you have all the proper references to EF. There might be a compiler warning indicating a problem.

Upvotes: 1

Related Questions