Announcing the Microsoft Entity Framework June 2011 CTP

 


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.

If you have previously installed this preview, please follow the uninstall instructions detailed below .


We are excited to announce the availability of the Microsoft Entity Framework June 2011 CTP. This release includes many frequently requested features for both the Entity Framework and the Entity Framework Designer within Visual Studio.

What’s in Entity Framework June 2011 CTP?

The Microsoft Entity Framework June 2011 CTP introduces both new runtime and design-time features. Here are some of the new runtime features:

  • The Enum data-type is now available in the Entity Framework. You can use either the Entity Designer within Visual Studio to model entities that have Enum properties, or use the Code First workflow to define entities that have Enum objects as properties. You can use your Enum property just like any other scalar property, such as in LINQ queries and updates.
  • Two new spatial data-types for Geography and Geometry are now natively supported by the Entity Framework. You can use these types and methods on these types as part of LINQ queries, for example to find the distance between two locations as part of a query.
  • You can now add table-valued functions to your entity data model. A table-valued function is similar to a stored procedure, but the result of executing the table-valued function is composable, meaning you can use it as part of a LINQ query.
  • Stored procedures can now have multiple result sets in your entity data model.
  • The Entity Framework June 2011 CTP includes several SQL generation improvements, especially around optimizing queries over models with table-per-type (TPT) inheritance.
  • LINQ queries are now automatically compiled and cached to improve query performance. In previous releases of the Entity Framework, you could use the CompiledQuery class to compile a LINQ query explicitly but in this CTP this happens automatically for LINQ queries.

There are several new features for the Entity Framework Designer within Visual Studio:

  • The Entity Designer now supports creation of Enums , spatial data-types and table-value functions from the designer surface.
  • You can now create multiple diagrams for each entity data model. Each diagram can contain entities and relationships to make visualizing your model easier. You can switch between diagrams using the Model Browser and include related entities on each diagram as an optional command.
  • The StoreGeneratedPattern for key columns can now be set on an entity Properties window and this value will propagate from your entity model down to the store definition.
  • Diagram information is now stored in a separate file from the edmx or entity code files.
  • When you import stored procedures using the Entity Model Wizard, you can now batch import your stored procedures as function imports. The result shape of each stored procedure will automatically become a new complex type in your entity model. This makes getting started with stored procedures very easy.
  • The Entity Designer surface now supports selection driven highlighting and entity shape coloring.

Getting the Microsoft Entity Framework June 2011 CTP

The Microsoft Entity Framework June 2011 CTP is available on the Microsoft Download Center and there are three separate installers. You will need to have Visual Studio 2010 SP1 to install and use the new Entity Designer. All three installers are available here and should be installed in the following order:

  1. Download and install the runtime installer for the Entity Framework 2011 CTP runtime components.
  2. Download and install the WCF Data Services 2011 CTP installer to use new features in WCF Data Services with the Entity Framework.
  3. Download and install the designer installer to use the new Entity Framework 2011 CTP entity designer within Visual Studio 2010 SP1.

Getting Started

There are a number of resources to help you get started with this CTP.

Targeting the Microsoft Entity Framework June 2011 CTP Runtime

The easiest way to use the CTP is to set your project’s target framework to Microsoft Entity Framework June 2011 CTP. This target framework allows use of the CTP versions of the Entity Framework assemblies in addition to the standard .NET 4.0 RTM assemblies.

To re-target a C# project:

  • Right-click the project in the Solution Explorer and choose Properties or select <Project> Properties from the Project menu.
  • On the Application tab, select Microsoft Entity Framework June 2011 CTP or Microsoft Entity Framework June 2011 CTP Client Profile from the Target framework dropdown.

  • A dialog box will appear indicating that the project needs to be closed and reopened to retarget the project. Click Yes.

To re-target a VB.NET project:

  • Right-click the project in the Solution Explorer and choose Properties or select <Project> Properties from the Project menu.
  • Select the Compile tab and click the Advanced Compile Options… button on the bottom left of the dialog.
  • Select Microsoft Entity Framework June 2011 CTP or Microsoft Entity Framework June 2011 CTP Client Profile from the Target framework dropdown.

  • Click Ok.
  • A dialog box will appear indicating that the project needs to be closed and reopened to retarget the project. Click Yes.

Walkthroughs

For assistance in using the new design-time and runtime features please refer to the following walkthroughs:

Support

The Entity Framework Pre-Release Forum can be used for questions relating to this release.

Uninstalling

We recommend installing the Microsoft Entity Framework June 2011 CTP in a non-production environment to avoid any risk associated with installing and uninstalling pre-release software. If the CTP is uninstalled, existing functionality installed with Visual Studio 2010 (such as the Entity Designer) may no longer be available. To restore the features that were removed, complete the following steps:

  1. Locate the Visual Studio 2010 installation DVD and insert it into your computer. If you are using an Express SKU of Visual Studio and don’t have the installation media, you can obtain new media here

  2. Launch an administrative-level command prompt and execute one of the following commands. These commands restore versions of the EF Tools files that were initially shipped with Visual Studio 2010.

    With Ultimate, Pro, or other non-Express SKUs:
    [DVD drive letter]:\WCU\EFTools\ADONETEntityFrameworkTools_enu.msi USING_EXUIH=1

    With C# Express, VB Express, and Visual Web Developer Express SKUs:

    [DVD drive letter]:\[VBExpress, VCSExpress, or VWDExpress]\WCU\EFTools\ADONETEntityFrameworkTools_enu.msi USING_EXUIH=1

  3. To update the EF Tools with what shipped with Visual Studio Service Pack 1, there are two options:

    To run an update only for EF Tools, create a DVD with Visual Studio Service Pack 1 and execute the following command from an administrative-level command prompt. This update will only take a few minutes to complete.

    msiexec /update [DVD drive letter]:\VS10sp1-KB983509.msp /package {14DD7530-CCD2-3798-B37D-3839ED6A441C}
    To avoid creating a DVD, reapply SP1. Launch the Uninstall/Change programs applet in the Control Panel, double-click on Microsoft Visual Studio 2010 Service Pack 1, and then choose the option to “Reapply Microsoft Visual Studio Service Pack 1.” This approach will take longer since all of SP1 will be applied, not just the EF Tools file updates.

What’s Not in the Entity Framework June 2011 CTP?

There are a number of commonly requested features that did not make it into this CTP of the Entity Framework. We appreciate that these are really important to you and our team has started work on a number of them already. We will be reaching out for your feedback on these features soon:

  • Stored Procedure or table-valued function support in Code First
  • Migration support in Code First
  • Customizable conventions in Code First
  • Unique constraints support
  • Batching create-update-delete statements during save
  • Second level caching

Thank You

It is important for us to hear about your experience using the Entity Framework and we appreciate any and all feedback you have regarding this CTP or other aspects of the Entity Framework. We thank you for giving us your valuable input and look forward to working together on this release.

ADO.NET Entity Framework Team