ADO.Net Entity Framework Feature Community Technology Preview Released!

Published 04 November 09 03:25 PM | dpblogs 

We’ve released an update of the Entity Framework Feature CTP!  The updated CTP includes many requested improvements and added features we’ve gathered from the community since the release of our first CTP and supports installation with Visual Studio 2010 Beta 2 as well.  Some of the improvements and added features added since the last CTP include:

  • Enhancements to Code Only, including-
    • Fine Grained Control over model
      • Specify Navigation Property Inverses
      • Specify Property Facets
      • Complex Types
    • Customizable Mappings
      • Change Table Name, Column Names
      • Specify Custom Inheritance Strategy
      • Entity Splitting
      • Join Table Mapping
  • The Self-Tracking Entities template, allowing code generation of EF entities that facilitate ease of use in WCF/N-Tier scenarios-
    • Foreign Key associations: Self-Tracking Entities can take advantage of the Foreign Keys in the Model feature added in .NET 4.0 Beta 2 and can contain both navigation properties and Foreign Key properties for the same association. Fix-up logic has been tidied up to be aware of FKs.
    • Support for Silverlight 3: Generated entity types can be compiled to target Silverlight 3 and can be used in combination with Silverlight-enabled WCF services.
    • Databinding support: Generated entity types now implement INotifyPropertyChanged and use ObservableCollections allowing them to work better with WPF and Silverlight databinding.
    • Richer concurrency control support: Self-Tracking Entities now support the same variations for optimistic concurrency control as the Entity Framework. Original values are preserved for all required properties according to their concurrency mode in the Entity Data Model.
    • Improved independent association support: The approach for managing entities with dangling references has been reengineered to avoid unnecessary database round-trips.
    • New and improved methods: AcceptChanges, StartTracking, StopTracking where added and the existing MarkAsX methods are now extension methods.
    • Generated code improvements and refactoring: The ApplyChanges implementation has been moved to the Context template so the template has no binary dependencies besides Entity Framework. Generated code for entity types have been refactored.

Over the next few weeks we’ll be posting walkthroughs that dive deeper into each feature.  We also have a few features we plan to release in CTP format in the next few months including an updated POCO code gen template.  Your comments and feedback are most welcome; please give us your comments here, our design blog, through Connect or through the ADO.NET Entity Framework pre-release forums.  Please stay tuned for more news!

Thanks!

The Entity Framework Team

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# Kathleen MacMahon said on November 4, 2009 8:48 PM:

EF 4 sounds fantastic.  

I could really use some small support on whether we are designing our requirement for a single instance supporting authenticated users against in multiple databases (up to 400 of the same schema) correctly with the current version.  At present its a bit trial and error with 'will it let me do this with the context' but could lead to major performance issues if we are forcing a square peg in a round hole.

I've searched the blogs and forums but there seems to be so little documentation on the subject. Or arguments that it cannot be done or is difficult to achieve.

Does the recommended approach become more evident at all in 4?  

Twitter me at:  kmacmahon

# Tim Laverty said on November 5, 2009 12:55 PM:

@ Kathleen- I'm not sure what specific guidance you need.  EF should scale well with the number of users for your application.  There are limits in that the EF context targets a single database but there's nothing limiting you from having your client or middle layer span heterogeneous operations.  Feel free to send me specific questions at timlav@microsoft.com.  

# Tony Sneed said on November 6, 2009 4:54 AM:

I don't see a POCO T4 template installed with the CTP.  The T4 template for self-tracking entities is there, but the template for POCO's seems to be missing.

# Faisal Mohamood said on November 6, 2009 9:07 AM:

Hi Tony, We didn't get the ability to update the POCO template for Beta2 as a part of this CTP release - but we are working on releasing that at some point in the near future.

# Steve Johnston said on November 9, 2009 3:46 PM:

I have a question about the new Entity Framework.  Right now, we are developing an application using Visual Studio and the current release version of the Entity Framework.  One of the problems that I am running into is the comlexity of the model.  As the database grows and changes, the model is becoming huge and useless to actually visualize the system.  I need to be able to break the model up in to smaller models that relate directly to services using them.  The problem is that there are some larger cross-cutting entities (Organizations \ Logons ) that are used everywhere.  I need to be able to include \ reference one model from another.  THe current model designer does not support that.  Is that a feature that will be available in the next version of EF?

# Rob Vettor said on November 9, 2009 8:49 PM:

In same boat as Steve Johnston.  Would very much like to hear about approaches to address this problem, especially new enhancements in EF 4 that will help resolve.

Thanks.

# Thomas Eriksson said on November 10, 2009 1:47 PM:

Hi, just wondering what happened with EntityChangeTrackerAdapter from CTP1 ?

What should we use instead?

BR

Thomas

# Tony Sneed said on November 11, 2009 8:02 PM:

Could you please explain more about support for Silverlight 3 and how generated entity types can be compiled to target Silverlight 3?

# Thomas D. said on November 11, 2009 11:44 PM:

I agree with Steve and Rob. It should be possible to have multiple "views" on the model, comparable to the database diagrams in SQL Server.

# jwinata said on November 12, 2009 9:54 AM:

We want to do quick performance evaluation on Self-Tracking Entities and POCO.  The walkthrough from http://blogs.msdn.com/adonet/archive/2009/06.aspx does not work with CTP 2.  Do you have an updated walkthrough that works with CTP 2?

# DonM said on November 12, 2009 10:47 AM:

Is there a list of changes in EF4?

# Tony Sneed said on November 12, 2009 6:53 PM:

Hello jwinata,

I've posted a walk-through for self-tracking entities using CTP 2 here:

http://blog.tonysneed.com/2009/11/12/ef-4-0-n-tier-support-take-2

# michel liesmons said on November 21, 2009 10:08 AM:

I have a problem when using the tt files from another folder than the one containing the edmx file:{”Mapping and metadata information could not be found for EntityType ‘Nais.Time.Model.Admin.Eventlog’.”}

When using the non-STE version it works fine.

Could it have someting to do with not using the ModelNamespace?

kr,

Michel.

# Tony Sneed said on November 22, 2009 8:24 AM:

You need to change the template to point to where the edmx file is located.  For example:

To reference it from another project, open Northwind.Types.tt and modify inputFile initialization as follows: string inputFile = @"..\NorthwindData\Northwind.edmx";

# michel liesmons said on November 22, 2009 8:25 AM:

I found a solution.

Nothing to do with splitting the generated context and types nor with more complex folder/namespace layouts.

I noticed that the context's MetadataWorkspace did not contain the right clr types for mapping.

I had a solution using both the EntityObject Generator and the Self-Tracking Entity (STE) Generator.

It seems they do not play well together...

When using an STE context while there were other models present using non-STE contexts, the MetadataWorkspace was 'polluted' with clr types of the non-STE model, sometimes the needed clr types were not present at all, hence the mapping failure I received.

Making my solution use only STE contexts, the MetadataWorkspace remains clean, and only the clr types of the required model are present.

I have no clue on what exactly causes the loading of non-STE clr types when using an STE model.

I do believe however that a solution should be able to use a mixture of T4 templates, some models might need tracking, others not.

kr,

Michel.

# cokkiy said on November 29, 2009 5:28 AM:

I agree with Steve and Rob too. The problem is a very big one we has been encountered when we in atual projects, there always more than 100 table in database.

Leave a Comment

(required) 
(optional)
(required) 

  
Enter Code Here: Required

Search

This Blog

Syndication

Page view tracker