Over a million developers have joined DZone.

Code Migrations Evolved: EF 4.3 Released

DZone 's Guide to

Code Migrations Evolved: EF 4.3 Released

· Database Zone ·
Free Resource

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


Source:  http://blogs.msdn.com/b/adonet/archive/2012/02/09/ef-4-3-released.aspx


Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}