My application is based on .NET 4.0 and EF 4. I'm now looking at upgrading to the latest versions.
EDIT: First of all, EF 5/.NET 4.5 has a major concern in that is will never support Windows XP or Server 2003 (or earlier). If you need support for either of those OS's, use EF 4.4 with .NET 4.0, which has none of the fun new stuff.
Also, I hit a (simple) breaking change relating to DataAnnotations moving namespaces:
Entity Framework 4.1 thru 4.3 included additional data annotations in the System.ComponentModel.DataAnnotations namespace in the EntityFramework assembly. In .NET 4.5 these annotations were moved to be part of the .NET Framework in the System.ComponentModel.DataAnnotations.Schema namespace of the System.ComponentModel.DataAnnotations.dll assembly. If you are using EF 4.x and targeting .NET 4.5 this results in two data annotations with the same name in different assemblies.
See http://blogs.msdn.com/b/adonet/archive/2012/02/29/ef4-3-1-and-ef5-beta-1-available-on-nuget.aspx, which still applies in EF 5 RTM.
In short, I had to add:
using System.ComponentModel.DataAnnotations; // had this already
using System.ComponentModel.DataAnnotations.Schema; // needed this one
to a zillion places.
How easy is the upgrade path? Does upgrading to EF 5 require any code changes or other work?
You'll have to upgrade to .net 4.5 for most new features to work.
Are there any new features related to code-first that would be worth upgrading for?
Not exactly related to code-first, because it's crosscutting, but still worth mentioning: Enum support.
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