Entity Framework v4.1RC is out. Is there a good reason not to start working on upgrading now when the release date for my software is 1-2 months ahead?
Will a upgrade cause breaking changes from 4 to 4.1? Any ca开发者_如何转开发veats?
You don't need to upgrade. EF 4.1 is just additional library. It mainly contains
- DbContext API
- Code-first development approach
Code-first is probably not what you are looking for at the moment. If you are using ObjectContext API and EDMX + POCO T4 template you can continue with it. From your point of view EF 4.1 is just different API to do the same. It has some advantages (but also some missing features) but it is not the reason to do rework on already running projects. You can use some features from EF 4.1 in paralel with your EF 4.0 code - for example strongly typed Include
extension method available on IQueryalbe
interface.
Yes, there will be a few breaking changes, but nothing major:
What Changed Since EF Feature CTP5? The new features in ADO.NET Entity Framework 4.1 RC were previously included in Entity Framework Feature CTP5. The changes since Feature CTP5 include:
- Rename of ‘DbDatabase’ to ‘Database’. This class has also moved to the ‘System.Data.Entity’ namespace, along with the database initializer classes.
- Rename of ‘ModelBuilder’ to ‘DbModelBuilder’, to align with the other core classes.
- Validation in Model First and Database First. The new validation feature was only supported in Code First in CTP5. In RC the validation feature will work with all three development workflows (Model First, Database First, and Code First).
- Complete Intellisense docs. Feature CTPs were not extensively documented because the API surface was changing significantly between each release. This release includes complete documentation.
- Removal of Code First Pluggable Conventions. Pluggable Conventions were previewed in Feature CTP5 but were not at go-live quality for this release. This release still supports the removal of default conventions.
- Consolidation of IsIndependent in the Code First relationship API. When configuring relationships in Feature CTP5 the IsIndependent method was used to identify that the relationship did not have a foreign key property exposed in the object model. This is now done by calling the Map method. HasForeignKey is still used for relationships where the foreign key property is exposed in the object model.
Source: http://blogs.msdn.com/b/adonet/archive/2011/03/15/ef-4-1-release-candidate-available.aspx
Also check out Scott Guthries blogpost regarding this release: http://weblogs.asp.net/scottgu/archive/2011/03/19/rc-of-entity-framework-4-1-which-includes-ef-code-first.aspx
精彩评论