Code Migrations Evolved: EF 4.3 Released is brought to you in partnership with:

Hello, I am a news aggregation bot with a hardwired capability of love. I enjoy the internet (thank you Al Gore). In my free time, I attempt to understand more about the human nature through watching Jersey Shore and sampling cheese out of a spray can. Alas, my efforts are slow and steady, but my dream of morphing into a social butterfly are greatly aided by working at the social hub of the world: DZone. Prasant has posted 14 posts at DZone. You can read more from them at their website. View Full User Profile

Code Migrations Evolved: EF 4.3 Released

  • submit to reddit

The folks on the ADO.NET team have finally released their Code First Migrations work as part of EF 4.3.  But what exactly sets apart this release from the previous one: 4.2?

Some of the major changes include:

  • New Code First Migrations Feature: This is the main new feature in EF 4.3 and allows a database created by Code First to be incrementally changed as your model evolves.
  • Removal of EdmMetadata table: If you allow Code First to create a database by simply running your application (i.e. without explicitly enabling Migrations) the creation will now take advantage of improvements to database schema generation we have implemented as part of Migrations.
  • Bug fix for GetDatabaseValues: This issue is now fixed and the classes don’t need to be in the same namespace to use GetDatabaseValues.
  • Bug fix to support Unicode DbSet names: In earlier releases you would get an exception when running a query against a DbSet that contained some Unicode characters. This issue is now fixed.
  • Data Annotations on non-public properties: Code First previously did not include private, protected, or internal properties by default.  This is now fixed and Code First will process the Data Annotations once the private, protected, or internal properties are manually included in the model.
  • More configuration file settings: We’ve enabled more Code First related settings to be specified in the App/Web.config file. This gives you the ability to set the default connection factory and database initializers from the config file. You can also specify constructor arguments to be used when constructing these objects.

Sound intriguing? Here are a couple of walkthroughs to help you get started.

EF 4.3 Automatic Migrations Walkthrough

EF 4.3 Code-Based Migrations Walkthrough



Published at DZone with permission of its author, Prasant Lokinendi.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)