240 likes | 254 Views
Learn about the features and improvements in Entity Framework 4.0, including better tools, design experience, and N-Tier persistence.
E N D
Entity Framework in the Microsoft .NET Framework 4 and Microsoft Visual Studio 2010 Eric Nelson eric.nelson@microsoft.com http://geekswithblogs.net/iupdateable http://twitter.com/ericnel Developer Evangelist Microsoft UK Session Code: DEV305
Agenda • Quick recap of the journey so far • Entity Framework 4.0 Drill Down • Lots of demos
Object Relational Mapping • Many ORMs out there • No clear “winner” = relatively little adoption of ORM • Developers waiting on Microsoft • Then we shipped two ... hmmm • LINQ to SQL in Visual Studio 2008 • ADO.NET Entity Framework in Visual Studio 2008 SP1
ADO.NET Entity Framework Recap Entity Data Model • Tools and services to create an Entity Data Model (EDM) • Conceptual to Mapping to Storage • Tools and services for consuming an Entity Data Model • LINQ to Entities, Object Services and Entity SQL • Together they address the “impedance mismatch” Objects in Applications Conceptual Mapping Storage Rows in Tables
Entity Framework 1.0Too many pain points • The designer! • Model First not supported • Poor support for Stored Procedures • No Pluralization/Singularization • Foreign Keys hidden • Lazy Loading not supported • Missing LINQ Operators vs LINQ to SQL • Generated SQL unreadable • No support for Plain Old CLR Objects • N-Tier difficult
Entity Framework 4.0Removing the friction • Better Tools and Design Experience • More powerful/flexible runtime • And • N-Tier* • Persistence Ignorance* • Code Only* • Note: • * Delivered in .NET Framework 4 and a separate download
Better Tools and Design Experience • Model First • Templated code generation • Stored Procedures • Pluralization/Singularization • Complex Types • Better delete and search
demo Model First and Templated Code Generation
More powerful/flexible runtime • Deferred Loading (aka lazy loading) • Foreign Keys surfaced • More complete LINQ implementation • ExecuteStoreQuery • EntityFunctions and SqlFunctions • Improvements to generated SQL
demo Deferred Loading, Generated SQL
Persistence Ignorance • First class support for Persistence Ignorance • No modifications to your classes!
demo Persistence Ignorance
N-Tier • Self Tracking Entities
demo N-Tier
Code Only • Create the database from the classes • No model • Convention to config
demo Code Only
Entity Framework • The designer! • No support for Plain Old CLR Objects • No Pluralization/Singularization • Foreign Keys hidden • Model First not supported • Lazy Loading not supported • Missing LINQ Operators vs LINQ to SQL • Generated SQL unreadable • N-Tier difficult • Poor support for Stored Procedures
Summary • Entity Framework 4.0 is rather nice! • We continue to listen and improve • Resources • Entity Framework 4.0 Resources http://bit.ly/ef4resources • Entity Framework Team Blog http://blogs.msdn.com/adonet/ • Entity Framework Design Blog http://blogs.msdn.com/efdesign/
Required Slide Speakers, TechEd 2009 is not producing a DVD. Please announce that attendees can access session recordings at TechEd Online. Resources • www.microsoft.com/teched Sessions On-Demand & Community • www.microsoft.com/learning • Microsoft Certification & Training Resources • http://microsoft.com/technet • Resources for IT Professionals • http://microsoft.com/msdn Resources for Developers
Required Slide Speakers, please list the Breakout Sessions, TLC Interactive Theaters and Labs that are related to your session. Related Content DAT04-IS Patterns with the Entity Framework Tue 11/10 9:00-10:15 WIA404 Data Driven Microsoft ASP.NET Web Forms Applications Wed 11/11 17:30-18:45 DAT202 What's New in ADO.NET Data Services Mon 11/9, 9:00-10:15
Complete an evaluation on CommNet and enter to win an Xbox 360 Elite!
Required Slide © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.