Announcing the Entity Framework POCO Template update for Visual Studio 2010 Beta 2


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.


Note: The download links in Visual Studio Gallery have been disabled while we prepare to release a refresh of the template that is compatible with Visual Studio 2010 Release Candidate. In the meanwhile, you can use the VSIX installers attached to this post, which are compatible with Visual Studio 2010 Beta 2 only.

Today we are releasing an updated version of the POCO entity generation templates that work with Visual Studio 2010 Beta 2. You can download them immediately using the Extension Manager inside Visual Studio 2010 Beta 2 or from the Visual Studio Gallery page, here for the C# version and here for the Visual Basic version.

Usage of the templates is described in the updated POCO Template Walkthrough.

The original version of this T4 template was included in the Entity Framework Feature CTP 1, and since we released the Feature CTP 2 last November without this feature, we have heard from lots of customers that they wanted us to work on a new version of it. 

Besides being compatible with Beta 2, the new template includes a number of bug fixes, generated code improvements, handling of relationship fixup that includes support for Foreign Keys in the Model (see more details here about this new feature of Entity Framework) and compatibility with change tracking POCO Proxies and ObservableCollection<T>.

The POCO Template is not going to be part of Visual Studio 2010 in RTM. Instead the current plan is to continue delivering updates for it through the Extension Manager and the Visual Studio Gallery.

Known issues in this version

  1. The POCO Template does not work with ASP.NET WebSite projects: A bug in multiple output file support prevents the POCO Template from working on WebSite projects. A fix will be available in a future update. In the meanwhile, you can place the template in a separate class library project and add a reference to the class library from the WebSite.
  2. Running a query with Include and MergeOption equal to NoTracking may cause an exception: There is a problem in the interaction between the implementation of relationships fixup code in classes generated by the POCO template and the change tracking POCO Proxies enabled by the POCO Template.  We are currently investigating this issue.
  3. Detach can cause nullable foreign keys properties to be nulled: The implementation of relationship fixup cannot distinguish the reason an entity is being removed from an object graph. When Detach is applied to an entity that is related to others through foreign key associations, fixup logic will react to references being nulled and elements being removed form collections and will set the corresponding FK properties to null. We are currently investigating this issue.
  4. The AssociationChanged event can be raised twice: The AssociationChanged event is raised twice with CollectionChangeAction.Add when fixup occurs in the model such that a collection is modified. We are currently investigating this issue.

 

Feedback is welcome

If you find any problem or you are missing any feature you would like to see us include in future versions, you can enter bugs and suggestions through the Microsoft Connect page for the Visual Studio 2010 & .NET Framework 4.0 Beta located here.

You can also provide feedback or asks your questions in the Entity Framework Pre-Release Forum.

Diego Vega,
Entity Framework Team

EF4Beta2PocoTemplates.zip