SlideShare a Scribd company logo
ADO.NET Entity Framework in Microsoft Visual Studio 2010 and Microsoft .NET Framework 4Eric Nelson eric.nelson@microsoft.comhttp://geekswithblogs.net/iupdateable(or http://bit.ly/ericnelson )http://twitter.com/ericnelhttp://twitter.com/ukmsdnDeveloper EvangelistMicrosoft UK
Were you on twitter last Dec?http://twitter.com/ericnel
AgendaQuick recap of the journey so farEntity Framework 4.0 Drill DownLots of demos
Object Relational MappingMany ORMs out thereNo clear “winner” = relatively little adoption of ORMDevelopers waiting on MicrosoftThen we shipped two ... hmmmLINQ to SQL in Visual Studio 2008ADO.NET Entity Framework in Visual Studio 2008 SP1
ADO.NET Entity Framework RecapEntity Data ModelTools and services to create an Entity Data Model (EDM)Conceptual to Mapping to StorageTools and services for consuming an Entity Data ModelLINQ to Entities, Object Services and Entity SQLTogether they address the “impedance mismatch” Objects in ApplicationsConceptualMappingStorageRows in Tables
Entity Framework 1.0Too many pain pointsThe designer!Model First not supportedPoor support for Stored ProceduresNo Pluralization/SingularizationForeign Keys hiddenLazy Loading not supportedMissing LINQ Operators vs LINQ to SQLGenerated SQL unreadableNo support for Plain Old CLR ObjectsN-Tier difficult
Entity Framework 4.0Removing the frictionBetter Tools and Design ExperienceMore powerful/flexible runtimeAndPersistence Ignorance*Code Only*N-Tier*Note:* Delivered in .NET Framework 4 and a separate download
Better Tools and Design ExperienceModel FirstTemplated code generationStored ProceduresPluralization/SingularizationComplex TypesBetter delete and search
Model First and Templated Code Generationdemo
More powerful/flexible runtimeLazy Loading (Deferred Loading in Beta 1 )Foreign Keys surfacedMore complete LINQ implementationExecuteStoreQueryEntityFunctions and SqlFunctionsImprovements to generated SQL
Deferred Loading, Functions, Generated SQLdemo
http://blogs.msdn.com/adonet/archive/2009/08/05/improvements-to-the-generated-sql-in-net-4-0-beta1.aspx
Persistence IgnoranceFirst class support for Persistence Ignorance No modifications to your classes!
Persistence Ignorancedemo
Code OnlyCreate the database from the classesNo modelConvention to config
Code Onlydemo
N-TierSelf Tracking Entities
N-Tierdemo
Entity Framework The designer!No support for Plain Old CLR ObjectsNo Pluralization/SingularizationForeign Keys hiddenModel First not supportedLazy Loading not supportedMissing LINQ Operators vs LINQ to SQLGenerated SQL unreadableN-Tier difficultPoor support for Stored Procedures
SummaryEntity Framework 4.0 is rather nice!We continue to listen and improveResourcesInstall VS2010 Beta 2 http://bit.ly/vs2010b2My blog for EF 4 posts http://bit.ly/ericnelsonChannel 9 Screencasts  on EF4 http://bit.ly/ch9ukdevteamEntity Framework 4.0 Resources http://bit.ly/ef4resourcesEntity Framework Team Blog http://blogs.msdn.com/adonet/Entity Framework Design Blog http://blogs.msdn.com/efdesign/

More Related Content

What's hot (20)

PPT
ADO.NET Entity Framework
Doncho Minkov
 
PDF
.NET Core, ASP.NET Core Course, Session 18
Amin Mesbahi
 
PPTX
Overview Of .Net 4.0 Sanjay Vyas
rsnarayanan
 
PDF
.NET Core, ASP.NET Core Course, Session 3
Amin Mesbahi
 
PDF
.NET Core, ASP.NET Core Course, Session 16
Amin Mesbahi
 
PPTX
Lerman Vvs14 Ef Tips And Tricks
Julie Lerman
 
PDF
.NET Core, ASP.NET Core Course, Session 8
Amin Mesbahi
 
PPTX
Introducing Entity Framework 4.0
Bishoy Demian
 
PDF
.NET Core, ASP.NET Core Course, Session 19
Amin Mesbahi
 
PPS
dot NET Framework
Roy Antony Arnold G
 
PDF
Learn Entity Framework in a day with Code First, Model First and Database First
Jibran Rasheed Khan
 
PPT
Presentation On Com Dcom
Bharat Kumar Katur
 
PDF
.NET Core, ASP.NET Core Course, Session 12
Amin Mesbahi
 
PDF
Working with oro crm entities
Oro Inc.
 
PPTX
Introduction to Core Java Programming
Raveendra R
 
PPT
Wwf
Vishwa Mohan
 
PDF
D1 from interfaces to solid
Arnaud Bouchez
 
DOCX
Chapter2
Namomsa Amanuu
 
PPTX
Java RMI
Ankit Desai
 
PPT
Corba by Example
Roy Antony Arnold G
 
ADO.NET Entity Framework
Doncho Minkov
 
.NET Core, ASP.NET Core Course, Session 18
Amin Mesbahi
 
Overview Of .Net 4.0 Sanjay Vyas
rsnarayanan
 
.NET Core, ASP.NET Core Course, Session 3
Amin Mesbahi
 
.NET Core, ASP.NET Core Course, Session 16
Amin Mesbahi
 
Lerman Vvs14 Ef Tips And Tricks
Julie Lerman
 
.NET Core, ASP.NET Core Course, Session 8
Amin Mesbahi
 
Introducing Entity Framework 4.0
Bishoy Demian
 
.NET Core, ASP.NET Core Course, Session 19
Amin Mesbahi
 
dot NET Framework
Roy Antony Arnold G
 
Learn Entity Framework in a day with Code First, Model First and Database First
Jibran Rasheed Khan
 
Presentation On Com Dcom
Bharat Kumar Katur
 
.NET Core, ASP.NET Core Course, Session 12
Amin Mesbahi
 
Working with oro crm entities
Oro Inc.
 
Introduction to Core Java Programming
Raveendra R
 
D1 from interfaces to solid
Arnaud Bouchez
 
Chapter2
Namomsa Amanuu
 
Java RMI
Ankit Desai
 
Corba by Example
Roy Antony Arnold G
 

Similar to Entity Framework 4 In Microsoft Visual Studio 2010 - ericnel (20)

PPT
Entity Framework 4 In Microsoft Visual Studio 2010
Eric Nelson
 
PPT
Entity Framework Overview
ukdpe
 
PPTX
Entity Framework v1 and v2
Eric Nelson
 
PPTX
Entity Framework V1 and V2
ukdpe
 
PPTX
What Impact Will Entity Framework Have On Architecture
Eric Nelson
 
PPTX
Microsoft Data Access Technologies
David Chou
 
PPT
ADO.NET Entity Framework
Hasnain Iqbal
 
PPT
What's New for Data?
ukdpe
 
PPTX
Entity framework
Tamer Elshahat
 
PPTX
Microsoft Entity Framework
Mahmoud Tolba
 
PPT
MySQL, LINQ and the ADO_NET Entity Framework Presentation.ppt
hammadali341730
 
PDF
Entity Framework 6 Recipes 2nd Edition Brian Driscoll
raffygobahc9
 
PPTX
Entity Framework 4
Stefano Paluello
 
PPTX
Entity Framework Today (May 2012)
Julie Lerman
 
PPTX
MVC and Entity Framework 4
James Johnson
 
PPTX
Building N Tier Applications With Entity Framework Services 2010
David McCarter
 
PPTX
ASP.NET MVC and Entity Framework 4
James Johnson
 
PPTX
Entity Framework Overview
Eyal Vardi
 
DOCX
Entity Framework
Mahesh Pachbhai
 
PDF
70487.pdf
Karen Benoit
 
Entity Framework 4 In Microsoft Visual Studio 2010
Eric Nelson
 
Entity Framework Overview
ukdpe
 
Entity Framework v1 and v2
Eric Nelson
 
Entity Framework V1 and V2
ukdpe
 
What Impact Will Entity Framework Have On Architecture
Eric Nelson
 
Microsoft Data Access Technologies
David Chou
 
ADO.NET Entity Framework
Hasnain Iqbal
 
What's New for Data?
ukdpe
 
Entity framework
Tamer Elshahat
 
Microsoft Entity Framework
Mahmoud Tolba
 
MySQL, LINQ and the ADO_NET Entity Framework Presentation.ppt
hammadali341730
 
Entity Framework 6 Recipes 2nd Edition Brian Driscoll
raffygobahc9
 
Entity Framework 4
Stefano Paluello
 
Entity Framework Today (May 2012)
Julie Lerman
 
MVC and Entity Framework 4
James Johnson
 
Building N Tier Applications With Entity Framework Services 2010
David McCarter
 
ASP.NET MVC and Entity Framework 4
James Johnson
 
Entity Framework Overview
Eyal Vardi
 
Entity Framework
Mahesh Pachbhai
 
70487.pdf
Karen Benoit
 
Ad

More from ukdpe (20)

PPTX
Mike Ormond: Silverlight for Windows Phone 7 (UK TechDays)
ukdpe
 
PPTX
Windows Phone 7: How (Not) to Fail Marketplace Ingestion
ukdpe
 
PPTX
Mike Ormond: Developing for Windows Phone 7
ukdpe
 
PPTX
Microsoft UK TechDays - jQuery and ASP.NET
ukdpe
 
PPTX
Microsoft UK TechDays - Top 10 ASP.NET 4.0 Features
ukdpe
 
PPTX
Microsoft UK TechDays - ASP.NET 4.0 Overview
ukdpe
 
PDF
Mike Taulty MIX10 Silverlight 4 Patterns Frameworks
ukdpe
 
PDF
Mike Taulty MIX10 Silverlight 4 Accelerated Fundamentals
ukdpe
 
PDF
Mike Taulty TechDays 2010 Silverlight and Windows Phone 7 CTP
ukdpe
 
PDF
Mike Taulty TechDays 2010 Silverlight 4 - What's New?
ukdpe
 
PDF
Mike Taulty DevDays 2010 Silverlight 4 - What's New Part 2
ukdpe
 
PDF
Mike Taulty DevDays 2010 Silverlight 4 - What's New Part 1
ukdpe
 
PDF
Mike Taulty DevDays 2010 Silverlight MEF
ukdpe
 
PDF
Mike Taulty DevDays 2010 Silverlight 4 Networking
ukdpe
 
PPTX
Mike Taulty MIX10 Silverlight Frameworks and Patterns
ukdpe
 
PPTX
Explaining The Cloud
ukdpe
 
PPTX
Microsoft In Education - Steve Beswick
ukdpe
 
DOC
How Microsoft Secures its Online Services [WHITEPAPER]
ukdpe
 
PPTX
Overview of Microsoft App-V 4.5
ukdpe
 
PPTX
Optimising your site for search engines
ukdpe
 
Mike Ormond: Silverlight for Windows Phone 7 (UK TechDays)
ukdpe
 
Windows Phone 7: How (Not) to Fail Marketplace Ingestion
ukdpe
 
Mike Ormond: Developing for Windows Phone 7
ukdpe
 
Microsoft UK TechDays - jQuery and ASP.NET
ukdpe
 
Microsoft UK TechDays - Top 10 ASP.NET 4.0 Features
ukdpe
 
Microsoft UK TechDays - ASP.NET 4.0 Overview
ukdpe
 
Mike Taulty MIX10 Silverlight 4 Patterns Frameworks
ukdpe
 
Mike Taulty MIX10 Silverlight 4 Accelerated Fundamentals
ukdpe
 
Mike Taulty TechDays 2010 Silverlight and Windows Phone 7 CTP
ukdpe
 
Mike Taulty TechDays 2010 Silverlight 4 - What's New?
ukdpe
 
Mike Taulty DevDays 2010 Silverlight 4 - What's New Part 2
ukdpe
 
Mike Taulty DevDays 2010 Silverlight 4 - What's New Part 1
ukdpe
 
Mike Taulty DevDays 2010 Silverlight MEF
ukdpe
 
Mike Taulty DevDays 2010 Silverlight 4 Networking
ukdpe
 
Mike Taulty MIX10 Silverlight Frameworks and Patterns
ukdpe
 
Explaining The Cloud
ukdpe
 
Microsoft In Education - Steve Beswick
ukdpe
 
How Microsoft Secures its Online Services [WHITEPAPER]
ukdpe
 
Overview of Microsoft App-V 4.5
ukdpe
 
Optimising your site for search engines
ukdpe
 
Ad

Recently uploaded (20)

PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
PDF
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PDF
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PDF
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
PDF
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 

Entity Framework 4 In Microsoft Visual Studio 2010 - ericnel

  • 1. ADO.NET Entity Framework in Microsoft Visual Studio 2010 and Microsoft .NET Framework 4Eric Nelson [email protected]://geekswithblogs.net/iupdateable(or http://bit.ly/ericnelson )http://twitter.com/ericnelhttp://twitter.com/ukmsdnDeveloper EvangelistMicrosoft UK
  • 2. Were you on twitter last Dec?http://twitter.com/ericnel
  • 3. AgendaQuick recap of the journey so farEntity Framework 4.0 Drill DownLots of demos
  • 4. Object Relational MappingMany ORMs out thereNo clear “winner” = relatively little adoption of ORMDevelopers waiting on MicrosoftThen we shipped two ... hmmmLINQ to SQL in Visual Studio 2008ADO.NET Entity Framework in Visual Studio 2008 SP1
  • 5. ADO.NET Entity Framework RecapEntity Data ModelTools and services to create an Entity Data Model (EDM)Conceptual to Mapping to StorageTools and services for consuming an Entity Data ModelLINQ to Entities, Object Services and Entity SQLTogether they address the “impedance mismatch” Objects in ApplicationsConceptualMappingStorageRows in Tables
  • 6. Entity Framework 1.0Too many pain pointsThe designer!Model First not supportedPoor support for Stored ProceduresNo Pluralization/SingularizationForeign Keys hiddenLazy Loading not supportedMissing LINQ Operators vs LINQ to SQLGenerated SQL unreadableNo support for Plain Old CLR ObjectsN-Tier difficult
  • 7. Entity Framework 4.0Removing the frictionBetter Tools and Design ExperienceMore powerful/flexible runtimeAndPersistence Ignorance*Code Only*N-Tier*Note:* Delivered in .NET Framework 4 and a separate download
  • 8. Better Tools and Design ExperienceModel FirstTemplated code generationStored ProceduresPluralization/SingularizationComplex TypesBetter delete and search
  • 9. Model First and Templated Code Generationdemo
  • 10. More powerful/flexible runtimeLazy Loading (Deferred Loading in Beta 1 )Foreign Keys surfacedMore complete LINQ implementationExecuteStoreQueryEntityFunctions and SqlFunctionsImprovements to generated SQL
  • 11. Deferred Loading, Functions, Generated SQLdemo
  • 13. Persistence IgnoranceFirst class support for Persistence Ignorance No modifications to your classes!
  • 15. Code OnlyCreate the database from the classesNo modelConvention to config
  • 19. Entity Framework The designer!No support for Plain Old CLR ObjectsNo Pluralization/SingularizationForeign Keys hiddenModel First not supportedLazy Loading not supportedMissing LINQ Operators vs LINQ to SQLGenerated SQL unreadableN-Tier difficultPoor support for Stored Procedures
  • 20. SummaryEntity Framework 4.0 is rather nice!We continue to listen and improveResourcesInstall VS2010 Beta 2 http://bit.ly/vs2010b2My blog for EF 4 posts http://bit.ly/ericnelsonChannel 9 Screencasts on EF4 http://bit.ly/ch9ukdevteamEntity Framework 4.0 Resources http://bit.ly/ef4resourcesEntity Framework Team Blog http://blogs.msdn.com/adonet/Entity Framework Design Blog http://blogs.msdn.com/efdesign/

Editor's Notes

  • #5: LLBLGen Pro http://www.llblgen.com/Nhibernatehttp://www.hibernate.org/343.htmlEntitySpaceshttp://www.entityspaces.net/Portal/Default.aspxOpen Access http://www.telerik.com/products/orm.aspxDevForcehttp://www.ideablade.com/XPO http://www.devexpress.com/Products/NET/ORM/Lightspeedhttp://www.mindscape.co.nz/products/LightSpeed/default.aspxPlus many, many moreOf 31 .NET ORMs in 2003, 9 lasted to 2008
  • #9: Code GenIn V1 we had EntityClassGenerator which could be configured using eventsHard (it used CodeDom)Inflexible (not much control)In V2 we will haveTemplatedEntityClassGenerator and will ship default T4 templatesCustomization via ToolsUses Workflow FoundationComplex typesPluralizationPublic abstract PluralizationServiceDefault implementation is English OnlyDefault rules:EntityTypes / ComplexTypes are singularizedEntitySets are pluralizedNavigation Properties based on cardinalityStored ProceduresStored Procedures as functionsMapping support for stored procedure resultComplex type as return typeScalar and void return typeEntity CUD using Stored ProceduresNo need to have SPs for all CUD
  • #11: Foreign KeysIndependent Association – v1 Product p = new Product { ID = 1,       Name = "Bovril",       Category = context.Categories                        .Single(c => c.Name == "Food") }; context.SaveChanges(); FK Association – v2 Product p = new Product     {         ID = 1,         Name = "Bovril",         CategoryID = 13     };     context.Products.AddObject(p);     context.SaveChanges();Deferred LoadingCan do lazy loadContext.deferredloading=true Model Level using ESQL<Function Name=“CustomerFullName” ReturnType=“String”><Parameter Name=“customer” Type=“MyModel.customer”> <DefiningExpression>customer.FirstName + ‘ ‘ + customer.LastName </DefiningExpression> </Function>Enables from c in ctx.Customers select c.FullName()CLR Level [EdmFunction("MyModel", "CustomerFullName")] public static string FullName(this customer c) { return String.Format("{0} {1}", c.FirstName, c.LastName); }Enables Console.WriteLine(c.FullName());Inline Functions in ESQL using Northwind;function AmountPurchased(c Customer) as Sum (c.Sales.Amt)function AmountReturned(c Customer) as Sum (c.Returns.Amt)function AmountConsumed(c Customer) as                                                                     AmountPurchased(c) – AmountReturned(c)select AmountConsumed(c) from Customers as c;
  • #16: Code OnlyNo XML files, no model!Convention to configE.g. Convention: xxxID to a primary key, schema=dboE.g. Config: On map to schema sys and class property to table column[TableMapping(Schema=“sys”,TableName=“MyDBTable”][ColumnMapping(PropertyName=“MyClassProp1”, ColumnName=“table_column1”)][Key(PropertyName=“MyClassProp1”)]public objectset<MyThing> MyThings...