Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When upgrading from EF5 to EF6 should I replace System.Data.Objects?

I am trying to replace EF5 with EF6 A lot of my code is giving type reference errors, Should I replace System.Data.Objects with System.Data.Entity.Core.Objects in my references?

[Update] Also do I replace System.Data.EntityState with System.Data.Entity.EntityState ?

like image 464
Kirsten Avatar asked May 25 '13 08:05

Kirsten


People also ask

When would you use EF6 vs EF core?

Keep using EF6 if the data access code is stable and not likely to evolve or need new features. Port to EF Core if the data access code is evolving or if the app needs new features only available in EF Core. Porting to EF Core is also often done for performance.

How can I change Entity Framework 6 to 5?

In this situation you can upgrade to EF5 using the following steps: Select Tools -> Library Package Manager -> Package Manager Console. Run Install-Package EntityFramework -version 5.0.

Does Entity Framework cache data?

Entity Framework has the following forms of caching built-in: Object caching – the ObjectStateManager built into an ObjectContext instance keeps track in memory of the objects that have been retrieved using that instance. This is also known as first-level cache.


2 Answers

Yes... You should update your references as follow:

System.Data.Objects -> System.Data.Entity.Core.Objects System.Data.EntityState -> System.Data.Entity.EntityState 
like image 44
Jacques Snyman Avatar answered Sep 18 '22 17:09

Jacques Snyman


A quote from the updating guide;

The general rule for namespace changes is that any type in System.Data.* is moved to System.Data.Entity.Core.*. In other words, just insert Entity.Core. after System.Data.

In other words, yes, you should update your references to the new namespace.

like image 122
Joachim Isaksson Avatar answered Sep 20 '22 17:09

Joachim Isaksson