2

We implemented a web application using EF 4.0 and ObjectContext. Now we would like to upgrade it to Ef 5 to get benefit of the performance improvements and new features, as described in Julie Lerman's article.

From the Infrasctructure point of view, the passage seems pretty smooth:

- Target the project to .NET 4.5 (if new features like ENUM support are needed)
- Upgrade/Install EF 5

However I could not find on the net good articles speaking about the needed steps and connected risks in passing from ObjectContext to DbContext.

As for now, my approach would be to create a separate code branch and upgrade EF there. Then substituting ObjectContext with DbContaxt API and refactor arising errors. Actually DbContext is a wrapper on top of ObjectContext developed to help developers in coding, therefore the exchange should (hopefully) be relatively smooth. We also use an interface as single point of contact to the Model, therefore this should also help to narrow down the required changes.

Community
  • 1
  • 1
Francesco
  • 9,947
  • 7
  • 67
  • 110
  • 1
    Since you are stating explicitly EF 4.0 maybe following previous question and answers does not apply for you, but juste in case, have you check them ? http://stackoverflow.com/questions/12652920/how-to-upgrade-from-entity-framework-4-3-to-ef-5 – Frédéric Mar 13 '14 at 18:14

0 Answers0