Data Driver

Blog archive

Entity Framework Gets Code First Model Generation Through Reverse Engineering

Microsoft last week released a minor version update of its popular Object Relational Mapping (ORM) tool with numerous bug fixes and new features, including the ability to reverse engineer an existing database to create a Code First model.

Entity Framework (EF) 6.1 is the first ".x" update since Microsoft open sourced the tool moving to version 6 and moved it to CodePlex. It features tooling consolidation that "extends the ADO.NET Entity Data Model wizard to support creating Code First models, including reverse engineering from an existing database," Microsoft's Rowan Miller explained in an ADO.NET Blog post.

Miller said this new functionality was available in beta quality in the EF Power Tools package, used by the engineering team to preview features under consideration for inclusion in a main release.

Developers can now right-click on a C# project to get a context menu item to "Reverse Engineer Code First," according to Data Developer Center documentation for the EF Power Tools. This command generates a derived DbContext class, "plain-old CLR object" (POCO) classes and Code First mapping classes from an existing database.

Another context menu item is available to "Customize Reverse Engineer Templates," which lets developers customize code generation via reverse engineer T4 templates added to projects.

According to project meeting notes that Microsoft developers now put online, the Code First models that can now be created with the wizard will lack certain features, such as the ability to split tables and entities, and support for complex types and enums, among others.

Microsoft has posted a Code First to an Existing Database video and walk-through where you can learn more about this new feature.

EF6.1 also includes a new IndexAttribute functionality that lets developers specifically identify database table indexes with an [Index] attribute attached to properties in Code First models.

Other enhancements to Entity Framework in version 6.1 listed by Miller include a CommitFailureHandler, public mapping API, performance improvements and many others.

Microsoft engineers such as Diego Vega and Pawel Kadluczka have been busy this week helping developers who reported problems with the new version update in the comments section of Miller's blog.

For more support, Microsoft recommends developers post questions on the StackOverflow site, where six questions had been posted as of today.

For future releases, the EF team's roadmap indicates it's considering "EF Everywhere," described as "a lighter-weight version of EF that can be used across a wide variety of platforms (including Windows Store and Windows Phone)."

Posted by David Ramel on 03/25/2014


comments powered by Disqus

Featured

  • Hands On: New VS Code Insiders Build Creates Web Page from Image in Seconds

    New Vision support with GitHub Copilot in the latest Visual Studio Code Insiders build takes a user-supplied mockup image and creates a web page from it in seconds, handling all the HTML and CSS.

  • Naive Bayes Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the naive Bayes regression technique, where the goal is to predict a single numeric value. Compared to other machine learning regression techniques, naive Bayes regression is usually less accurate, but is simple, easy to implement and customize, works on both large and small datasets, is highly interpretable, and doesn't require tuning any hyperparameters.

  • VS Code Copilot Previews New GPT-4o AI Code Completion Model

    The 4o upgrade includes additional training on more than 275,000 high-quality public repositories in over 30 popular programming languages, said Microsoft-owned GitHub, which created the original "AI pair programmer" years ago.

  • Microsoft's Rust Embrace Continues with Azure SDK Beta

    "Rust's strong type system and ownership model help prevent common programming errors such as null pointer dereferencing and buffer overflows, leading to more secure and stable code."

  • Xcode IDE from Microsoft Archrival Apple Gets Copilot AI

    Just after expanding the reach of its Copilot AI coding assistant to the open-source Eclipse IDE, Microsoft showcased how it's going even further, providing details about a preview version for the Xcode IDE from archrival Apple.

Subscribe on YouTube

Upcoming Training Events