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 ?
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.
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.
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.
Yes... You should update your references as follow:
System.Data.Objects -> System.Data.Entity.Core.Objects System.Data.EntityState -> System.Data.Entity.EntityState
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With