SlideShare a Scribd company logo
1 of 16
ADO.NET
E N T I T Y F R A M E W O R K
Clint Edmonson & Josh Gillespie
Polaris Solutions
Accretive Health Developer Days
AGENDA
• Introduction to EF 5
• Development Approaches
• Tips & Tricks
• What’s coming in EF 6
INTRODUCTION
• EntityFramework NuGet Package
• Included in Visual Studio 2012
• Works with Visual Studio 2010
• Works with .NET 4.0 and 4.5
• Most new features require .NET 4.5
ENTITY FRAMEWORK 5 (EF5)
• EF designer and code first
• Enum support
• Spatial data types
• Performance improvements
• EF designer only
• Table-valued Functions (TVFs)
• Multiple diagrams and coloring
• DbContext code generation
NEW IN EF5
New
Database
Existing
Database
Design First
Database First
Reverse engineer model in EF Designer
Classes auto-generated from model
Model First
Create model in EF Designer
Generate database from model
Classes auto-generated from model
DEVELOPER WORKFLOWS
Code First
Code First
Define classes and mapping in code
EF Power Tools provide reverse engineer
Code First
Define classes and mapping in code
Database created from code
Migrations apply model changes to database
EF ARCHITECTURE
• Providers
• Context
• Set
• Entities
TIPS & TRICKS
ADVANCED TECHNIQUES
• Enums
• Complex Types
• Many to Many relationships
• Proxies & Lazy loading
TIPS & TRICKS
• Stored procedures and raw SQL calls
• EF Power Tools
• SQL statement profiling
• DbSet.AsNoTracking
• IQueryable.Load()
• IQueryable.ToList()
• DbSet.Local
OTHER CONSIDERATIONS…
• Transactions
• Unit testing
• Service boundaries
• Concurrency
• Entity mapping strategies
• Async query and save
• Dependency injection pattern
• Code first custom conventions
• Enums, spatial, etc. on .NET 4.0
• Connection resiliency (retry)
• Tooling consolidation
• Code first stored procedure support
COMING IN EF6
QUESTIONS?
THANK YOU!
Clint Edmonson
clint.edmonson@polarissolutions.com
Josh Gillespie
josh.gillespie@polarissolutions.com
APPENDIX
References
• http://msdn.microsoft.com/data/ef
• http://entityframework.codeplex.com/wikipage?title=specs
• http://visualstudiogallery.msdn.microsoft.com/72a60b14-1581-
4b9b-89f2-846072eff19d
• http://msdn.microsoft.com/en-us/data/bb419139
• http://jkowalski.com/2010/04/23/logging-sql-statements-in-
entity-frameworkcode-first/

More Related Content

Viewers also liked

Viewers also liked (6)

Application architecture jumpstart
Application architecture jumpstartApplication architecture jumpstart
Application architecture jumpstart
 
Advanced oop laws, principles, idioms
Advanced oop laws, principles, idiomsAdvanced oop laws, principles, idioms
Advanced oop laws, principles, idioms
 
State of agile 2016
State of agile 2016State of agile 2016
State of agile 2016
 
Application Architecture Jumpstart
Application Architecture JumpstartApplication Architecture Jumpstart
Application Architecture Jumpstart
 
Lean & Agile DevOps with VSTS and TFS 2015
Lean & Agile DevOps with VSTS and TFS 2015Lean & Agile DevOps with VSTS and TFS 2015
Lean & Agile DevOps with VSTS and TFS 2015
 
Agile Metrics That Matter
Agile Metrics That MatterAgile Metrics That Matter
Agile Metrics That Matter
 

Similar to ADO.NET Entity Framework

Lap Around Entity Framework
Lap Around Entity FrameworkLap Around Entity Framework
Lap Around Entity Framework
Jaliya Udagedara
 
Be04 introduction to ef 6.0
Be04   introduction to ef 6.0Be04   introduction to ef 6.0
Be04 introduction to ef 6.0
DotNetCampus
 
eZ Publish 5, Re architecture, pitfalls and opportunities
eZ Publish 5, Re architecture, pitfalls and opportunitieseZ Publish 5, Re architecture, pitfalls and opportunities
eZ Publish 5, Re architecture, pitfalls and opportunities
André Rømcke
 
MWLUG 2011: The Never Ending Integration Story
MWLUG 2011: The Never Ending Integration StoryMWLUG 2011: The Never Ending Integration Story
MWLUG 2011: The Never Ending Integration Story
John Head
 

Similar to ADO.NET Entity Framework (20)

Lap Around Entity Framework
Lap Around Entity FrameworkLap Around Entity Framework
Lap Around Entity Framework
 
Building data centric applications for web, desktop and mobile with Entity Fr...
Building data centric applications for web, desktop and mobile with Entity Fr...Building data centric applications for web, desktop and mobile with Entity Fr...
Building data centric applications for web, desktop and mobile with Entity Fr...
 
EF Core 1: News features and changes
EF Core 1: News features and changesEF Core 1: News features and changes
EF Core 1: News features and changes
 
Deep Dive into Entity Framework 6.0
Deep Dive into Entity Framework 6.0Deep Dive into Entity Framework 6.0
Deep Dive into Entity Framework 6.0
 
EF6 or EF Core? How Do I Choose?
EF6 or EF Core? How Do I Choose?EF6 or EF Core? How Do I Choose?
EF6 or EF Core? How Do I Choose?
 
Be04 introduction to ef 6.0
Be04   introduction to ef 6.0Be04   introduction to ef 6.0
Be04 introduction to ef 6.0
 
Learn Entity Framework in a day with Code First, Model First and Database First
Learn Entity Framework in a day with Code First, Model First and Database FirstLearn Entity Framework in a day with Code First, Model First and Database First
Learn Entity Framework in a day with Code First, Model First and Database First
 
eZ Publish 5, Re architecture, pitfalls and opportunities
eZ Publish 5, Re architecture, pitfalls and opportunitieseZ Publish 5, Re architecture, pitfalls and opportunities
eZ Publish 5, Re architecture, pitfalls and opportunities
 
Leverage Entity Framework 7 in Business Application Design
Leverage Entity Framework 7 in Business Application Design Leverage Entity Framework 7 in Business Application Design
Leverage Entity Framework 7 in Business Application Design
 
.NET Core, ASP.NET Core Course, Session 16
.NET Core, ASP.NET Core Course, Session 16.NET Core, ASP.NET Core Course, Session 16
.NET Core, ASP.NET Core Course, Session 16
 
Ow
OwOw
Ow
 
Entity Framework 7: New features and changes
Entity Framework 7:New features and changesEntity Framework 7:New features and changes
Entity Framework 7: New features and changes
 
Eclipse e4 - Google Eclipse Day
Eclipse e4 - Google Eclipse DayEclipse e4 - Google Eclipse Day
Eclipse e4 - Google Eclipse Day
 
Entity Framework Core 1.0
Entity Framework Core 1.0Entity Framework Core 1.0
Entity Framework Core 1.0
 
From .NET Core 3, all the rest will be legacy
From .NET Core 3, all the rest will be legacyFrom .NET Core 3, all the rest will be legacy
From .NET Core 3, all the rest will be legacy
 
Getting Started with VSTO
Getting Started with VSTOGetting Started with VSTO
Getting Started with VSTO
 
.NET Fringe 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET Fringe 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund.NET Fringe 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET Fringe 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
 
MWLUG 2011: The Never Ending Integration Story
MWLUG 2011: The Never Ending Integration StoryMWLUG 2011: The Never Ending Integration Story
MWLUG 2011: The Never Ending Integration Story
 
Entity Framework 4 In Microsoft Visual Studio 2010 - ericnel
Entity Framework 4 In Microsoft Visual Studio 2010 - ericnelEntity Framework 4 In Microsoft Visual Studio 2010 - ericnel
Entity Framework 4 In Microsoft Visual Studio 2010 - ericnel
 
Flexible delivery options
Flexible delivery options Flexible delivery options
Flexible delivery options
 

More from Clint Edmonson

Visual Studio 2010 Ultimate
Visual Studio 2010 UltimateVisual Studio 2010 Ultimate
Visual Studio 2010 Ultimate
Clint Edmonson
 
Building a Twitter App with Silverlight 3 - Part 2
Building a Twitter App with Silverlight 3 - Part 2Building a Twitter App with Silverlight 3 - Part 2
Building a Twitter App with Silverlight 3 - Part 2
Clint Edmonson
 

More from Clint Edmonson (20)

New Product Concept Design.pptx
New Product Concept Design.pptxNew Product Concept Design.pptx
New Product Concept Design.pptx
 
Lean & Agile Essentials
Lean & Agile EssentialsLean & Agile Essentials
Lean & Agile Essentials
 
MICROSOFT BLAZOR - NEXT GENERATION WEB UI OR SILVERLIGHT ALL OVER AGAIN?
MICROSOFT BLAZOR - NEXT GENERATION WEB UI OR SILVERLIGHT ALL OVER AGAIN?MICROSOFT BLAZOR - NEXT GENERATION WEB UI OR SILVERLIGHT ALL OVER AGAIN?
MICROSOFT BLAZOR - NEXT GENERATION WEB UI OR SILVERLIGHT ALL OVER AGAIN?
 
Flow, the Universe and Everything
Flow, the Universe and EverythingFlow, the Universe and Everything
Flow, the Universe and Everything
 
Application architecture jumpstart
Application architecture jumpstartApplication architecture jumpstart
Application architecture jumpstart
 
Code smells and Other Malodorous Software Odors
Code smells and Other Malodorous Software OdorsCode smells and Other Malodorous Software Odors
Code smells and Other Malodorous Software Odors
 
Windows Azure Jumpstart
Windows Azure JumpstartWindows Azure Jumpstart
Windows Azure Jumpstart
 
Introduction to Windows Azure Virtual Machines
Introduction to Windows Azure Virtual MachinesIntroduction to Windows Azure Virtual Machines
Introduction to Windows Azure Virtual Machines
 
Peering through the Clouds - Cloud Architectures You Need to Master
Peering through the Clouds - Cloud Architectures You Need to MasterPeering through the Clouds - Cloud Architectures You Need to Master
Peering through the Clouds - Cloud Architectures You Need to Master
 
Architecting Scalable Applications in the Cloud
Architecting Scalable Applications in the CloudArchitecting Scalable Applications in the Cloud
Architecting Scalable Applications in the Cloud
 
Windows Azure jumpstart
Windows Azure jumpstartWindows Azure jumpstart
Windows Azure jumpstart
 
Windows Azure Virtual Machines
Windows Azure Virtual MachinesWindows Azure Virtual Machines
Windows Azure Virtual Machines
 
A Force of One - Agile and the Solo Developer
A Force of One - Agile and the Solo DeveloperA Force of One - Agile and the Solo Developer
A Force of One - Agile and the Solo Developer
 
Agile is as Agile Does
Agile is as Agile DoesAgile is as Agile Does
Agile is as Agile Does
 
Visual Studio 2010 Ultimate
Visual Studio 2010 UltimateVisual Studio 2010 Ultimate
Visual Studio 2010 Ultimate
 
Visual Studio 2010 - The Good Stuff
Visual Studio 2010 - The Good StuffVisual Studio 2010 - The Good Stuff
Visual Studio 2010 - The Good Stuff
 
Architecting Applications the Microsoft Way
Architecting Applications the Microsoft WayArchitecting Applications the Microsoft Way
Architecting Applications the Microsoft Way
 
Intro to VS 2010 & .Net 4.0
Intro to VS 2010 & .Net 4.0Intro to VS 2010 & .Net 4.0
Intro to VS 2010 & .Net 4.0
 
Sky High With Azure
Sky High With AzureSky High With Azure
Sky High With Azure
 
Building a Twitter App with Silverlight 3 - Part 2
Building a Twitter App with Silverlight 3 - Part 2Building a Twitter App with Silverlight 3 - Part 2
Building a Twitter App with Silverlight 3 - Part 2
 

Recently uploaded

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Recently uploaded (20)

Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 

ADO.NET Entity Framework

Editor's Notes

  1. ABCs of ORMsEntity Framework ArchitectureDB agnostic abstraction over DB-specific providersApproachesDesignerCode FirstShared Feature Tour/ComparisonEnumSpatial typesFunctions/SprocsLazy vs. eager loadingChange tracking/proxiesInheritance PatternsConcurrency PatternsWorkflowsModel FirstDB FirstCode First New DBCode First Old DBHow to Choose?Best Practices, Tips, TricksView Generation/warm-upConfiguration specificityUnit TestingRetry/Transient faultResist Lazy-LoadService Boundary considerationsoutputToolsEF Power ToolsMiniProfiler/GlimpseLINQPadComing up - Dev Roadmap (EF6)AsyncConnection ResiliencyDependency ResolutionInterception/SQL LoggingBetterTestabilityCustom ConventionsQ&A
  2. Where are you today?How are you structured (are DBAs and Devs totally separate?)Ground rules (e.g. please stop us if you have questions)