Data Driver

Blog archive

VS2010 Compatibility and Code Only Extensions Arrive in EF 4 Feature CTP

One of the key pieces missing in Beta 2 of Microsoft's ADO.NET Entity Framework 4 was compatibility with Visual Studio 2010 Beta 2 and the completed Code Only extensions that the company promised (see Entity Framework Gets More Code Only Extensions)

Microsoft released Beta 2 of the Entity Framework 4 October 19th (see EF4 Beta 2 Arrives with New Features) addressing many of the shortcomings of version 1 such as its focus on the data aspect of entities and its failure to support POCO (Plain Old CLR Objects), lazy loading and persistence ignorance.

The first release was a database-design first framework rather than model-first, says Roger Jennings, principal consultant, OakLeaf Systems

Microsoft put the finishing touches on the Entity Framework 4 this week releasing the Feature Community Test Preview, which is now available for download.

"Hooray for compatibility, but more importantly, we can now work with a greatly enhanced version of the Code Only feature and Self-Tracking Entities," writes .NET consultant Julie Lerman in a blog posting. "Code Only is the API that allows you to use EF without a model at all. Self-Tracking Entities provides tracking for entities across WCF Services and their clients."

Lerman is author of the book Programming Entity Framework (O'Reilly and Partners, 2009) and is writing an update covering the new release. Among other things, she told me that Code Only will appeal to those critical of the Entity Framework's focus on XML.

"If you don’t want to deal with the model but you still want to be able to do the querying without having to worry about going back and forth with the database or physically having to create the model, those are the benefits Code Only gives," Lerman explains." Since the Entity Framework absolutely relies on the XML and metadata, what Code Only does at run time and on the fly is it creates that meta data, and gives it to Entity Framework to do what it needs to do."

According to the ADO.NET Team Blog, the Code Only improvements include the following:  

    • 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 CTP also includes the Self-Tracking Entities template, which permits code generation of Entity Framework 4 entities "that facilitate ease of use in WCF/N-Tier scenarios."

Lerman and others I've spoken with over the past two weeks describe the Entity Framework 4 as a vast improvement over version 1 though others say it still lags what's available in NHibernate and other object request mapping tools. A full report will appear in the December issue of Visual Studio Magazine.

Posted by Jeffrey Schwartz on 11/05/2009 at 1:15 PM

comments powered by Disqus


  • How to Create a Machine Learning Decision Tree Classifier Using C#

    After earlier explaining how to compute disorder and split data in his exploration of machine learning decision tree classifiers, resident data scientist Dr. James McCaffrey of Microsoft Research now shows how to use the splitting and disorder code to create a working decision tree classifier.

  • Microsoft: Move from Traditional ASP.NET to 'Core' Requires 'Heavy Lifting'

    There are plenty of reasons to move traditional ASP.NET web apps -- part of the old .NET Framework -- to the new cross-platform direction, ASP.NET Core, but beware it will require some "heavy lifting," Microsoft says.

  • Purple Blue Nebula Graphic

    How to Compute Disorder for Machine Learning Decision Trees Using C#

    Using a decision tree classifier from a machine learning library is often awkward because it usually must be customized and library decision trees have many complex supporting functions, says resident data scientist Dr. James McCaffrey, so when he needs a decision tree classifier, he always creates one from scratch. Here's how.

  • Blazor's Future: gRPC Is Key

    Blazor guru Steve Sanderson detailed what Microsoft is thinking about the future of the revolutionary project that enables .NET-based web development using C# instead of JavaScript, explaining how gRPC is key, along with a new way of testing and a scheme for installable desktop apps.

  • Don't Do It All Yourself: Exploiting gRPC Well Known Types in .NET Core

    If you're creating business services that send dates and decimal data then you may be concerned that gRPC services don't support the relevant data types. Don't Panic! There are solutions. Here's how to use them.

.NET Insight

Sign up for our newsletter.

Terms and Privacy Policy consent

I agree to this site's Privacy Policy.

Upcoming Events