Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Code Migrations Evolved: EF 4.3 Released

DZone's Guide to

Code Migrations Evolved: EF 4.3 Released

· Database Zone
Free Resource

Check out the IT Market Clock report for recommendations on how to consolidate and replace legacy databases. Brought to you in partnership with MariaDB.

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

Interested in reducing database costs by moving from Oracle Enterprise to open source subscription?  Read the total cost of ownership (TCO) analysis. Brought to you in partnership with MariaDB.

Topics:

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

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

{{ parent.tldr }}

{{ parent.urlSource.name }}