What’s new with Entity Framework in Visual Studio 2010 RC

The information in this post is out of date.

Visit msdn.com/data/ef for the latest information on current and past releases of EF.

Visual Studio 2010 and .NET Framework 4 RC was announced earlier this week on Soma’s blog.

Included in this release are a set of improvements in Entity Framework runtime and designer. Here are some of the highlights:

Entity Framework

  • Better N-Tier support: Visual Studio 2010 now includes code generation templates for  Self-Tracking Entities. You no longer have to download the Entity Framework Feature CTP to get this functionality. Self-Tracking Entities are POCO classes that can track their changes. This makes them ideal for many N-Tier scenarios.

Please note that previous versions of Entity Framework Feature CTP include Self Tracking Entities that are incompatible with Visual Studio 2010 RC, so please do not install EF Feature CTP 1 or EF Feature CTP 2 on top of Visual Studio 2010 RC.

  • DDL Generation Provider: Entity Framework now includes DDL generation and the ability to create a database based on a model. Methods to create and delete database and to check existence of a database are now available on ObjectContext. If you have used Code-First capability in the Entity Framework Feature CTP (previously known as Code Only), you are already familiar with this functionality. Any Entity Framework provider can support DDL generation. Provider specific details can be found here

New versions of Code First and POCO Template for Visual Studio 2010 RC are currently in the works and will be released shortly – please watch this blog for details.

In addition to the two new features mentioned above, there are a lot of improvements that are either bug fixes or performance improvements. Some of the fixes include:

  • ProxyDataContractResolver can be used with DataContract serialization to serialize POCO Proxies as the original POCO types
  • Issue with stored procedure update of multiple entities has been fixed.
  • Improvement to make multi-file T4 code generation fall back to single file generation in WebSites.
  • Improvements to FK support for entities that don’t do fixup
  • Reduction of ViewState footprint of EntityDataSource
  • EntityDataSource sets DataKeyNames correctly at design-time

Entity Framework Designer

Entity Framework designer includes bug fixes and performance improvements in this release. Some of the improvements include:

  • Indexes added on foreign keys in Model-First scenarios
  • Ability to attach CopyToSSDL XMl attribute to CSDL annotations – this causes them to be copied to SSDL during Model-First
  • Better control over key definition for views so that unusable keys inferred during reverse engineering can be fixed
  • Better control of StoreGeneratedPattern value for table columns by setting it on the mapped property in the model
  • View definition and StoreGeneratedPattern is preserved during SSDL update from database
  • Support for SQL Azure connections

These are just a few of the changes you can expect to see. As you try Entity Framework and the Designer, let us know what you think of some of these improvements.

Entity Framework Team