Entity Framework (EF) 4.3.0 Beta 1 Released

The Beta 1 of Entity Framework (EF) 4.3 is now available, and has been primarily about integrating migrations into the EntityFramework NuGet package, improving quality and cleaning up the API surface ready to RTM.Microsoft ADO.NET also announced that they planning for this to be the last pre-release version of migrations and the next release will […]

Entity Framework (EF) 4.3 ReleasedThe Beta 1 of Entity Framework (EF) 4.3 is now available, and has been primarily about integrating migrations into the EntityFramework NuGet package, improving quality and cleaning up the API surface ready to RTM.

Microsoft ADO.NET also announced that they planning for this to be the last pre-release version of migrations and the next release will be the final RTM of EF 4.3.

Notable changes to Code First Migrations include:

  • "New Enable-Migrations command let you add the Migrations folder and Configuration class to your project. This command will also automatically fill in your context type in the Configuration class (provided you have a single context defined in your project).
  • Update-Database.exe command line tool can be used to run the migrations process from a command line. You can find this tool in the 'packages\EntityFramework.4.3.0-beta1\tools\' under your solutions directory. The syntax for this command line tool is very similar to the Update-Database power shell command. Run 'Update-Database /?' from a command prompt for more information on the syntax.
  • Migrations database initializer (System.Data.Entity.MigrateDatabaseToLatestVersion) that can be used to automatically upgrade to the latest version when your application launches.
  • Complete xml documentation (IntelliSense) for the migrations API surface.
  • Improved logging. If you specify the -Verbose flag when running commands in Package Manager Console we now provide more information to help with debugging," informed the team.

Other changes include:

  • Removal of EdmMetadata table. If you allow Code First to create a database by simply running your application (without using Migrations) the creation is now performed as an Automatic Migration. You can then enable migrations and continue evolving your database using migrations.
  • Data Annotations on non-public properties. Code First will not include private, protected or internal properties by default. If you manually include them in your model Code First used to ignore any Data Annotations on those members. This is now fixed and Code First will process the Data Annotations.
  • 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. More details are available in the EF 4.3 Configuration File Settings blog post.

You can get EF 4.3 Beta 1 by installing the latest pre-release version of the EntityFramework NuGet package.

"You will need NuGet 1.6 installed and specify the -IncludePrerelease flag at the Package Manager Console to get this pre-release version. Pre-release packages can only be installed from the Package Manager Console," the team said.