0

I am writing an MVC application which is using Entity Framework 5 as its ORM. Actually I copied POCO generator classes from existing application, and as the owner of that code said the project is using EF 4 POCO generator classes, I will need to upgrade it to use EF5 POCO generator.

Anyone know how to achieve this?

Sorry for not providing any sourcecode, as I am not sure what I should provide!

can anyone help me by using the information I have provided? thanks

Nirman
  • 6,715
  • 19
  • 72
  • 139
  • you probably need to copy T4 templates that generate classes and not classes themselves – Pawel Mar 03 '13 at 22:34

1 Answers1

1

There is no automatic upgrade from EF4 POCO generator to EF5 POCO generator. The generated entity classes will be very similar except some fixup in navigation properties but the problem is the context class which will be completely different with completely different API. Every data access related code using ObjectContext derived context from EF4 POCO generator will have to be rewritten to use DbContext derived context from EF5 POCO context or the IObjectContextAdapter will have to be used to convert DbContext back to ObjectContext.

Ladislav Mrnka
  • 360,892
  • 59
  • 660
  • 670