Entity Framework POCO Template updated for Visual Studio 2010 Release Candidate


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.


A refresh of the POCO Template that is compatible with Visual Studio 2010 Release Candidate is now available in the Extension Manager of Visual Studio and through Visual Studio Gallery.

For an introduction on how to use the template, please see the POCO Template Walkthrough (no updates have been made to the walkthrough for this version).

The RC compatible version of the POCO Template contains all the improvements made in the Beta 2 compatible version, including generated code improvements, relationship fixup, foreign keys, etc. In addition, the new version includes additional but fixes and compatibility with ASP.NET Web Site projects. 

There are now four different versions of the template:

  1. The standard VB version is here
  2. The standard C# version is here.
  3. A new version for VB ASP.NET Web Sites is here.
  4. A new version for C# ASP.NET Web Sites is here.

Note that 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 Visual Studio Gallery.

Known issues in this version

  1. 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.
  2. 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.
  3. 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.
  4. Cascade delete rules are not triggered with FK-based self-referencing associations: If you define an FK association for entity with other entities of the same set (i.e. each Employee entity has a Manager and a ManagerID property that point to another Employee) and you define an OnDelete Action=”Cascade” rule in the association, dependent entities won’t be automatically marked as deleted when the principal is deleted. 

Note that the Beta 2 compatible versions are no longer available in Visual Studio Gallery. If you still need a version for Visual Studio 2010 Beta 2, you can temporarily find it attached to the original announcement.

Your feedback is welcome

If you run into any problem or limitation with the POCO Template, please enter a bug or suggestion through the Microsoft Connect site for Entity Framework.

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

Diego Vega,
Entity Framework Team