SlideShare a Scribd company logo
Eric Nelson
Developer & Platform Group
Microsoft Ltd
eric.nelson@microsoft.com
http://geekswithblogs.net/IUpdateable
http://twitter.com/ericnel
Accessing data in 1990
• ODBC, embedded SQL


   Accessing data in 2000
   • ADO, Stored Procedures


       Accessing data in 2005
       • ADO.NET, Datasets, DataReaders

           Accessing data in 2010
           • ORM baby!
What is it?
   an Abstraction
   technique for working with relational tables as if they
   were objects in memory
   Intention is to hide away the complexity of the
   underlying tables and give a uniform way of working
   with data
Why use it?
   Developer productivity
   Retain database independence
Note:
   Using an ORM does not mean you must use the ORM!
Many ORMs out there
     LLBLGen Pro http://www.llblgen.com/
     Nhibernate http://www.hibernate.org/343.html
     EntitySpaces http://www.entityspaces.net/Portal/Default.aspx
     Open Access http://www.telerik.com/products/orm.aspx
     DevForce http://www.ideablade.com/
     XPO http://www.devexpress.com/Products/NET/ORM/
     Lightspeed
     http://www.mindscape.co.nz/products/LightSpeed/default.aspx
     Plus many, many more
No clear “winner” = relatively little
adoption of ORM
   Developers waiting on Microsoft
   Of 31 .NET ORMs in 2003, 9 lasted to 2008
Typed Datasets (cough) – shipped 
   ObjectSpaces “v1” – never shipped 
   ObjectSpaces “v2” – never shipped 
   Microsoft Business Framework – never shipped 
   WinFS – never shipped 
   LINQ to SQL - shipped November 2007 
       Visual Studio 2008 & .NET Framework 3.5
   LINQ to Entities - shipped August 2008 
       Visual Studio 2008 SP1 & .NET Framework 3.5 SP1


Note: LINQ to Entities is the most visible part of the
  ADO.NET Entity Framework
Entity Framework and LINQ to Entities is our strategic
technology
   Entity Framework v2 in VS2010 and .NET Framework 4.0
      Best of LINQ to SQL moves into LINQ to Entities
   Microsoft is using it
      Data Services - shipping
      Reporting Services
      Microsoft “M”
Partners supporting it
   Database Vendors – IBM,OpenLink, Data Direct, Devart etc
   ORM vendors supporting it
      DevForce now target Entity Framework, replacing their own
      LLBLGen v3 will target Entity Framework as well as their own

It is not just about ORM
What is LINQ?
   LINQ is not about databases, it is about objects
   LINQ = Language-Integrated Query
      Extensions to programming languages to query objects in memory
Why use it?
   Productivity!!! LINQ rocks
   www.linqpad.net
We ship
   LINQ to Objects
   LINQ to XML
   LINQ to Datasets
   LINQ to SQL – just SQL Server
   LINQ to Entities – added in .NET Framework 3.5 SP1
Others make LINQ to Flickr etc
{ Simple Walkthough }
LINQ to SQL       LINQ to Entities
Database Support    SQL Server        SQL Server, DB2,
                                      Oracle, Sybase,
                                      MySQL ...
Object Relational   Simple            Complex
Mapping
Capabilities
                    Not strategic 
Status                                Strategic
                                      Often 
Annoying            Rarely
Entity Framework is not just about ORM
Entity Framework v1 is being adopted
  Typically on applications expected to “live” a
  long time
Entity Framework is only .NET 3.5 SP1 and
above
Entity Framework is probably not the best
choice for a “short lived” SQL Server
applications
Entity Framework v1 has “warts”
    Designer
                       It is annoying – buggy, clunky
                       Exposes subset of the functionality
                       Does not support model first
    N-tier story
    Stored Procedure Support
    Foreign Keys
    PoCo
    Guids
    SQL 2008 New Types
“EF is still cutting
development time
                       “the entity framework
 in half. Ya gotta
                         can kiss my damn
     love it.”
                          ass - this shit is
                             ridiculous”
What is it?
   Tools and services to create an Entity Data Model
     EDM gives ORM to SQL Server, Oracle, DB2 etc
   Tools and services for consuming an Entity Data
   Model
Why use it?
   Productivity
   Complex mapping between entities and database
   tables
   Works great with ADO.NET Data Services
Notes
   Strategic but just released...
Entity Data Model
Application model
   Mapped to a persistence
   store
                                Conceptual
Comprised of three
layers:
   Conceptual (CSDL)
   Mapping (MSL)                 Mapping
   Storage (SSDL)
Database agnostic
Comprised of:
                                 Storage
   Entities
   Associations
   Functions
{ A look at mapping }
2      1               The ORM
                           - optional
         Object Services
3


        Entity Client
Familiar ADO.NET object model:
  EntityCommand
  EntityConnection
  EntityDataReader
  EntityParameter
  EntityTransaction
Text-based results
Read-only
Uses Entity SQL
Queries materialized as Objects
   ObjectContext
   ObjectQuery<T>
Built on top of Entity Client
Two query options:
   Entity SQL
   LINQ
Runtime services:
   Unit of work
   Identity tracking
   Eager/explicit loading
{ Consuming an EDM}
ORM is an abstraction layer about data
 • Productivity
 • Database Independence
Microsoft has two ORMs
 • LINQ to SQL – only SQL Server
 • Entity Framework (includes LINQ to Entities) – many RDBMS, strategic
ADO.NET Entity Framework includes all the other bits 
 • EDM, Linq to Entities, ESQL, Object Services
 • Part of .NET Framework 3.5 SP1
Entity Data Model – mapping from conceptual to store
 • CSDL = Conceptual Schema Definition Language
 • SSDL = Store Schema Definition Language
 • MSDL = Mapping Schema Definition Language
Two query languages
 • ESQL = Entity SQL. Read only query language similar to SQL
 • LINQ to Entities = Language Integrated Query to the EDM
• .NET Framework 4.0
Entity Framework v2 • http://blogs.msdn.com/efdesign

 Entity Framework • Across MS Products and Technologies
more widely adopted • Reporting Services vNext

                       • Better ORM capabilities in LINQ to Entities
   Rough edges
                       • POCO support, N-Tier, Model First
     removed

 Technologies work     • e.g. ASP.NET Dynamic Data and Entity
                         Framework
   better together

                       • Less xml editing during development
   Better tooling
1990 to   • Data Access technology remained
            reasonably static
2007 -    • Procedural, API access
          • Surfaced the database schema
Tables    • No clear ORM choice



          • LINQ – excellent addition to the .NET
2008 –      languages
          • Entity Framework and the EDM – strategic
Objects     investment
          • Productivity leap
http://geekswithblogs.net/IUpdateable
Or
http://iupdateable.com
© 2008 Microsoft Ltd. 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.

More Related Content

What's hot

Cloud Application Development – The Future is now
Cloud Application Development – The Future is nowCloud Application Development – The Future is now
Cloud Application Development – The Future is now
SPEC INDIA
 
Cloud and Grid Computing
Cloud and Grid ComputingCloud and Grid Computing
Cloud and Grid Computing
Leen Blom
 
Neo4j graph database
Neo4j graph databaseNeo4j graph database
Neo4j graph database
Prashant Bhargava
 
Spring Framework
Spring FrameworkSpring Framework
Spring Framework
NexThoughts Technologies
 
Cloud computing benefits
Cloud computing benefitsCloud computing benefits
Cloud computing benefits
Madhukumar Vattipulusu
 
java Jdbc
java Jdbc java Jdbc
java Jdbc
Ankit Desai
 
Servlet & JSP 教學手冊第二版試讀 - 撰寫與設定 Servlet
Servlet & JSP 教學手冊第二版試讀 - 撰寫與設定 ServletServlet & JSP 教學手冊第二版試讀 - 撰寫與設定 Servlet
Servlet & JSP 教學手冊第二版試讀 - 撰寫與設定 Servlet
Justin Lin
 
Introduction to es6
Introduction to es6Introduction to es6
Introduction to es6
NexThoughts Technologies
 
Data science in ruby is it possible? is it fast? should we use it?
Data science in ruby is it possible? is it fast? should we use it?Data science in ruby is it possible? is it fast? should we use it?
Data science in ruby is it possible? is it fast? should we use it?
Rodrigo Urubatan
 
Laravel Presentation
Laravel PresentationLaravel Presentation
Laravel Presentation
REZAUL KARIM REFATH
 
Accesibilidad práctica con HTML5, CSS3 y WAI-ARIA
Accesibilidad práctica con HTML5, CSS3 y WAI-ARIAAccesibilidad práctica con HTML5, CSS3 y WAI-ARIA
Accesibilidad práctica con HTML5, CSS3 y WAI-ARIA
Manuel Razzari
 
Introduction to JSX
Introduction to JSXIntroduction to JSX
Introduction to JSX
Micah Wood
 
Equivalences and diffrences between SysML and Arcadia / Capella
Equivalences and diffrences between SysML and Arcadia / CapellaEquivalences and diffrences between SysML and Arcadia / Capella
Equivalences and diffrences between SysML and Arcadia / Capella
Obeo
 
Jdbc complete
Jdbc completeJdbc complete
Jdbc complete
Sandeep Rawat
 
Java API
Java APIJava API
Leveraging Knowledge Graphs in your Enterprise Knowledge Management System
Leveraging Knowledge Graphs in your Enterprise Knowledge Management SystemLeveraging Knowledge Graphs in your Enterprise Knowledge Management System
Leveraging Knowledge Graphs in your Enterprise Knowledge Management System
Semantic Web Company
 
12c weblogic installation steps for Windows
12c weblogic installation steps for Windows12c weblogic installation steps for Windows
12c weblogic installation steps for Windows
Cognizant
 
JDBC,Types of JDBC,Resultset, statements,PreparedStatement,CallableStatements...
JDBC,Types of JDBC,Resultset, statements,PreparedStatement,CallableStatements...JDBC,Types of JDBC,Resultset, statements,PreparedStatement,CallableStatements...
JDBC,Types of JDBC,Resultset, statements,PreparedStatement,CallableStatements...
Pallepati Vasavi
 
RDBMS to Graph
RDBMS to GraphRDBMS to Graph
RDBMS to Graph
Neo4j
 
JPA For Beginner's
JPA For Beginner'sJPA For Beginner's
JPA For Beginner's
NarayanaMurthy Ganashree
 

What's hot (20)

Cloud Application Development – The Future is now
Cloud Application Development – The Future is nowCloud Application Development – The Future is now
Cloud Application Development – The Future is now
 
Cloud and Grid Computing
Cloud and Grid ComputingCloud and Grid Computing
Cloud and Grid Computing
 
Neo4j graph database
Neo4j graph databaseNeo4j graph database
Neo4j graph database
 
Spring Framework
Spring FrameworkSpring Framework
Spring Framework
 
Cloud computing benefits
Cloud computing benefitsCloud computing benefits
Cloud computing benefits
 
java Jdbc
java Jdbc java Jdbc
java Jdbc
 
Servlet & JSP 教學手冊第二版試讀 - 撰寫與設定 Servlet
Servlet & JSP 教學手冊第二版試讀 - 撰寫與設定 ServletServlet & JSP 教學手冊第二版試讀 - 撰寫與設定 Servlet
Servlet & JSP 教學手冊第二版試讀 - 撰寫與設定 Servlet
 
Introduction to es6
Introduction to es6Introduction to es6
Introduction to es6
 
Data science in ruby is it possible? is it fast? should we use it?
Data science in ruby is it possible? is it fast? should we use it?Data science in ruby is it possible? is it fast? should we use it?
Data science in ruby is it possible? is it fast? should we use it?
 
Laravel Presentation
Laravel PresentationLaravel Presentation
Laravel Presentation
 
Accesibilidad práctica con HTML5, CSS3 y WAI-ARIA
Accesibilidad práctica con HTML5, CSS3 y WAI-ARIAAccesibilidad práctica con HTML5, CSS3 y WAI-ARIA
Accesibilidad práctica con HTML5, CSS3 y WAI-ARIA
 
Introduction to JSX
Introduction to JSXIntroduction to JSX
Introduction to JSX
 
Equivalences and diffrences between SysML and Arcadia / Capella
Equivalences and diffrences between SysML and Arcadia / CapellaEquivalences and diffrences between SysML and Arcadia / Capella
Equivalences and diffrences between SysML and Arcadia / Capella
 
Jdbc complete
Jdbc completeJdbc complete
Jdbc complete
 
Java API
Java APIJava API
Java API
 
Leveraging Knowledge Graphs in your Enterprise Knowledge Management System
Leveraging Knowledge Graphs in your Enterprise Knowledge Management SystemLeveraging Knowledge Graphs in your Enterprise Knowledge Management System
Leveraging Knowledge Graphs in your Enterprise Knowledge Management System
 
12c weblogic installation steps for Windows
12c weblogic installation steps for Windows12c weblogic installation steps for Windows
12c weblogic installation steps for Windows
 
JDBC,Types of JDBC,Resultset, statements,PreparedStatement,CallableStatements...
JDBC,Types of JDBC,Resultset, statements,PreparedStatement,CallableStatements...JDBC,Types of JDBC,Resultset, statements,PreparedStatement,CallableStatements...
JDBC,Types of JDBC,Resultset, statements,PreparedStatement,CallableStatements...
 
RDBMS to Graph
RDBMS to GraphRDBMS to Graph
RDBMS to Graph
 
JPA For Beginner's
JPA For Beginner'sJPA For Beginner's
JPA For Beginner's
 

Viewers also liked

Разработка, тестирование и развертывание баз данных в Visual Studio Team Syst...
Разработка, тестирование и развертывание баз данных в Visual Studio Team Syst...Разработка, тестирование и развертывание баз данных в Visual Studio Team Syst...
Разработка, тестирование и развертывание баз данных в Visual Studio Team Syst...
Dmitry Andreev
 
Разработка БД с использованием инструментов MS VS 2010
Разработка БД с использованием инструментов MS VS 2010Разработка БД с использованием инструментов MS VS 2010
Разработка БД с использованием инструментов MS VS 2010Александр Шамрай
 
datatable ,dataset,datagridview in C#
datatable ,dataset,datagridview in C#datatable ,dataset,datagridview in C#
datatable ,dataset,datagridview in C#
Д. Бүжинлхам
 
Кириллин Иван (МойСклад): Секреты работы с клиентской базой
Кириллин Иван (МойСклад): Секреты работы с клиентской базойКириллин Иван (МойСклад): Секреты работы с клиентской базой
Кириллин Иван (МойСклад): Секреты работы с клиентской базой
MoySklad
 
Entity framework
Entity frameworkEntity framework
Entity frameworkScaiper
 
Lecture15
Lecture15Lecture15
Lecture15orgil
 
Управление данными (распределенная обработка)
Управление данными (распределенная обработка)Управление данными (распределенная обработка)
Управление данными (распределенная обработка)
Ural Federal University named after First President of Russia B.N. Yeltsin
 
Управление данными. Основы проектирования БД
Управление данными. Основы проектирования БДУправление данными. Основы проектирования БД
Управление данными. Основы проектирования БД
Ural Federal University named after First President of Russia B.N. Yeltsin
 
Lecture vcp413
Lecture vcp413Lecture vcp413
Lecture vcp413orgil
 

Viewers also liked (10)

Разработка, тестирование и развертывание баз данных в Visual Studio Team Syst...
Разработка, тестирование и развертывание баз данных в Visual Studio Team Syst...Разработка, тестирование и развертывание баз данных в Visual Studio Team Syst...
Разработка, тестирование и развертывание баз данных в Visual Studio Team Syst...
 
Разработка БД с использованием инструментов MS VS 2010
Разработка БД с использованием инструментов MS VS 2010Разработка БД с использованием инструментов MS VS 2010
Разработка БД с использованием инструментов MS VS 2010
 
datatable ,dataset,datagridview in C#
datatable ,dataset,datagridview in C#datatable ,dataset,datagridview in C#
datatable ,dataset,datagridview in C#
 
Кириллин Иван (МойСклад): Секреты работы с клиентской базой
Кириллин Иван (МойСклад): Секреты работы с клиентской базойКириллин Иван (МойСклад): Секреты работы с клиентской базой
Кириллин Иван (МойСклад): Секреты работы с клиентской базой
 
Entity framework
Entity frameworkEntity framework
Entity framework
 
Lecture15
Lecture15Lecture15
Lecture15
 
.NET Development
.NET Development.NET Development
.NET Development
 
Управление данными (распределенная обработка)
Управление данными (распределенная обработка)Управление данными (распределенная обработка)
Управление данными (распределенная обработка)
 
Управление данными. Основы проектирования БД
Управление данными. Основы проектирования БДУправление данными. Основы проектирования БД
Управление данными. Основы проектирования БД
 
Lecture vcp413
Lecture vcp413Lecture vcp413
Lecture vcp413
 

Similar to Entity Framework Overview

Entity Framework v1 and v2
Entity Framework v1 and v2Entity Framework v1 and v2
Entity Framework v1 and v2
Eric Nelson
 
Entity Framework V1 and V2
Entity Framework V1 and V2Entity Framework V1 and V2
Entity Framework V1 and V2
ukdpe
 
Entity Framework Overview
Entity Framework OverviewEntity Framework Overview
Entity Framework Overview
ukdpe
 
What's New for Data?
What's New for Data?What's New for Data?
What's New for Data?ukdpe
 
Building nTier Applications with Entity Framework Services (Part 1)
Building nTier Applications with Entity Framework Services (Part 1)Building nTier Applications with Entity Framework Services (Part 1)
Building nTier Applications with Entity Framework Services (Part 1)
David McCarter
 
Model Driven Architecture (MDA): Motivations, Status & Future
Model Driven Architecture (MDA): Motivations, Status & FutureModel Driven Architecture (MDA): Motivations, Status & Future
Model Driven Architecture (MDA): Motivations, Status & Futureelliando dias
 
70487.pdf
70487.pdf70487.pdf
70487.pdf
Karen Benoit
 
Building nTier Applications with Entity Framework Services (Part 1)
Building nTier Applications with Entity Framework Services (Part 1)Building nTier Applications with Entity Framework Services (Part 1)
Building nTier Applications with Entity Framework Services (Part 1)
David McCarter
 
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
ukdpe
 
Asp.net new
Asp.net newAsp.net new
Asp.net new
Ganesh Jaya
 
What Impact Will Entity Framework Have On Architecture
What Impact Will Entity Framework Have On ArchitectureWhat Impact Will Entity Framework Have On Architecture
What Impact Will Entity Framework Have On Architecture
Eric Nelson
 
Data Driven WPF and Silverlight Applications
Data Driven WPF and Silverlight ApplicationsData Driven WPF and Silverlight Applications
Data Driven WPF and Silverlight ApplicationsDave Allen
 
LINQ 2 SQL Presentation To Palmchip And Trg, Technology Resource Group
LINQ 2 SQL Presentation To Palmchip  And Trg, Technology Resource GroupLINQ 2 SQL Presentation To Palmchip  And Trg, Technology Resource Group
LINQ 2 SQL Presentation To Palmchip And Trg, Technology Resource Group
Shahzad
 
Migrating To Visual Studio 2008 & .Net Framework 3.5
Migrating To Visual Studio 2008 & .Net Framework 3.5Migrating To Visual Studio 2008 & .Net Framework 3.5
Migrating To Visual Studio 2008 & .Net Framework 3.5
Clint Edmonson
 
Migrating To Visual Studio 2008 & .Net Framework 3.5
Migrating To Visual Studio 2008 & .Net Framework 3.5Migrating To Visual Studio 2008 & .Net Framework 3.5
Migrating To Visual Studio 2008 & .Net Framework 3.5Jeff Blankenburg
 
ADO.NET Entity Framework DevDays
ADO.NET Entity Framework DevDaysADO.NET Entity Framework DevDays
ADO.NET Entity Framework DevDays
ukdpe
 
Building N Tier Applications With Entity Framework Services 2010
Building N Tier Applications With Entity Framework Services 2010Building N Tier Applications With Entity Framework Services 2010
Building N Tier Applications With Entity Framework Services 2010
David McCarter
 
Microsoft Entity Framework
Microsoft Entity FrameworkMicrosoft Entity Framework
Microsoft Entity Framework
Mahmoud Tolba
 

Similar to Entity Framework Overview (20)

Entity Framework v1 and v2
Entity Framework v1 and v2Entity Framework v1 and v2
Entity Framework v1 and v2
 
Entity Framework V1 and V2
Entity Framework V1 and V2Entity Framework V1 and V2
Entity Framework V1 and V2
 
Entity Framework Overview
Entity Framework OverviewEntity Framework Overview
Entity Framework Overview
 
What's New for Data?
What's New for Data?What's New for Data?
What's New for Data?
 
Ow
OwOw
Ow
 
Building nTier Applications with Entity Framework Services (Part 1)
Building nTier Applications with Entity Framework Services (Part 1)Building nTier Applications with Entity Framework Services (Part 1)
Building nTier Applications with Entity Framework Services (Part 1)
 
Model Driven Architecture (MDA): Motivations, Status & Future
Model Driven Architecture (MDA): Motivations, Status & FutureModel Driven Architecture (MDA): Motivations, Status & Future
Model Driven Architecture (MDA): Motivations, Status & Future
 
70487.pdf
70487.pdf70487.pdf
70487.pdf
 
Building nTier Applications with Entity Framework Services (Part 1)
Building nTier Applications with Entity Framework Services (Part 1)Building nTier Applications with Entity Framework Services (Part 1)
Building nTier Applications with Entity Framework Services (Part 1)
 
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
 
Asp.net new
Asp.net newAsp.net new
Asp.net new
 
What Impact Will Entity Framework Have On Architecture
What Impact Will Entity Framework Have On ArchitectureWhat Impact Will Entity Framework Have On Architecture
What Impact Will Entity Framework Have On Architecture
 
Data Driven WPF and Silverlight Applications
Data Driven WPF and Silverlight ApplicationsData Driven WPF and Silverlight Applications
Data Driven WPF and Silverlight Applications
 
LINQ 2 SQL Presentation To Palmchip And Trg, Technology Resource Group
LINQ 2 SQL Presentation To Palmchip  And Trg, Technology Resource GroupLINQ 2 SQL Presentation To Palmchip  And Trg, Technology Resource Group
LINQ 2 SQL Presentation To Palmchip And Trg, Technology Resource Group
 
Migrating To Visual Studio 2008 & .Net Framework 3.5
Migrating To Visual Studio 2008 & .Net Framework 3.5Migrating To Visual Studio 2008 & .Net Framework 3.5
Migrating To Visual Studio 2008 & .Net Framework 3.5
 
Migrating To Visual Studio 2008 & .Net Framework 3.5
Migrating To Visual Studio 2008 & .Net Framework 3.5Migrating To Visual Studio 2008 & .Net Framework 3.5
Migrating To Visual Studio 2008 & .Net Framework 3.5
 
ADO.NET Entity Framework DevDays
ADO.NET Entity Framework DevDaysADO.NET Entity Framework DevDays
ADO.NET Entity Framework DevDays
 
Building N Tier Applications With Entity Framework Services 2010
Building N Tier Applications With Entity Framework Services 2010Building N Tier Applications With Entity Framework Services 2010
Building N Tier Applications With Entity Framework Services 2010
 
Microsoft Entity Framework
Microsoft Entity FrameworkMicrosoft Entity Framework
Microsoft Entity Framework
 
Help desk
Help deskHelp desk
Help desk
 

More from Eric Nelson

SQL Azure Dec 2010 Update
SQL Azure Dec 2010 UpdateSQL Azure Dec 2010 Update
SQL Azure Dec 2010 Update
Eric Nelson
 
SQL Azure Dec Update
SQL Azure Dec UpdateSQL Azure Dec Update
SQL Azure Dec UpdateEric Nelson
 
Windows Azure Platform in 30mins by ericnel
Windows Azure Platform in 30mins by ericnelWindows Azure Platform in 30mins by ericnel
Windows Azure Platform in 30mins by ericnel
Eric Nelson
 
Technology Roadmap by ericnel
Technology Roadmap by ericnelTechnology Roadmap by ericnel
Technology Roadmap by ericnel
Eric Nelson
 
Windows Azure Platform in 30mins by ericnel
Windows Azure Platform in 30mins by ericnelWindows Azure Platform in 30mins by ericnel
Windows Azure Platform in 30mins by ericnel
Eric Nelson
 
10 things ever architect should know about the Windows Azure Platform - ericnel
10 things ever architect should know about the Windows Azure Platform -  ericnel10 things ever architect should know about the Windows Azure Platform -  ericnel
10 things ever architect should know about the Windows Azure Platform - ericnel
Eric Nelson
 
Lap around the Windows Azure Platform - ericnel
Lap around the Windows Azure Platform - ericnelLap around the Windows Azure Platform - ericnel
Lap around the Windows Azure Platform - ericnel
Eric Nelson
 
Windows Azure Platform best practices by ericnel
Windows Azure Platform best practices by ericnelWindows Azure Platform best practices by ericnel
Windows Azure Platform best practices by ericnel
Eric Nelson
 
Windows Azure Platform: Articles from the Trenches, Volume One
Windows Azure Platform: Articles from the Trenches, Volume OneWindows Azure Platform: Articles from the Trenches, Volume One
Windows Azure Platform: Articles from the Trenches, Volume One
Eric Nelson
 
Looking at the clouds through dirty windows
Looking at the clouds through dirty windows Looking at the clouds through dirty windows
Looking at the clouds through dirty windows
Eric Nelson
 
SQL Azure Overview for Bizspark day
SQL Azure Overview for Bizspark daySQL Azure Overview for Bizspark day
SQL Azure Overview for Bizspark day
Eric Nelson
 
Building An Application For Windows Azure And Sql Azure
Building An Application For Windows Azure And Sql AzureBuilding An Application For Windows Azure And Sql Azure
Building An Application For Windows Azure And Sql Azure
Eric Nelson
 
Entity Framework 4 In Microsoft Visual Studio 2010
Entity Framework 4 In Microsoft Visual Studio 2010Entity Framework 4 In Microsoft Visual Studio 2010
Entity Framework 4 In Microsoft Visual Studio 2010
Eric Nelson
 
Windows Azure In 30mins for none technical audience
Windows Azure In 30mins for none technical audienceWindows Azure In 30mins for none technical audience
Windows Azure In 30mins for none technical audience
Eric Nelson
 
Dev305 Entity Framework 4 Emergency Slides
Dev305 Entity Framework 4 Emergency SlidesDev305 Entity Framework 4 Emergency Slides
Dev305 Entity Framework 4 Emergency Slides
Eric Nelson
 
Design Considerations For Storing With Windows Azure
Design Considerations For Storing With Windows AzureDesign Considerations For Storing With Windows Azure
Design Considerations For Storing With Windows Azure
Eric Nelson
 
Windows Azure Overview
Windows Azure OverviewWindows Azure Overview
Windows Azure OverviewEric Nelson
 
SQL Data Service Overview
SQL Data Service OverviewSQL Data Service Overview
SQL Data Service OverviewEric Nelson
 
SQL Server 2008 Overview
SQL Server 2008 OverviewSQL Server 2008 Overview
SQL Server 2008 Overview
Eric Nelson
 

More from Eric Nelson (19)

SQL Azure Dec 2010 Update
SQL Azure Dec 2010 UpdateSQL Azure Dec 2010 Update
SQL Azure Dec 2010 Update
 
SQL Azure Dec Update
SQL Azure Dec UpdateSQL Azure Dec Update
SQL Azure Dec Update
 
Windows Azure Platform in 30mins by ericnel
Windows Azure Platform in 30mins by ericnelWindows Azure Platform in 30mins by ericnel
Windows Azure Platform in 30mins by ericnel
 
Technology Roadmap by ericnel
Technology Roadmap by ericnelTechnology Roadmap by ericnel
Technology Roadmap by ericnel
 
Windows Azure Platform in 30mins by ericnel
Windows Azure Platform in 30mins by ericnelWindows Azure Platform in 30mins by ericnel
Windows Azure Platform in 30mins by ericnel
 
10 things ever architect should know about the Windows Azure Platform - ericnel
10 things ever architect should know about the Windows Azure Platform -  ericnel10 things ever architect should know about the Windows Azure Platform -  ericnel
10 things ever architect should know about the Windows Azure Platform - ericnel
 
Lap around the Windows Azure Platform - ericnel
Lap around the Windows Azure Platform - ericnelLap around the Windows Azure Platform - ericnel
Lap around the Windows Azure Platform - ericnel
 
Windows Azure Platform best practices by ericnel
Windows Azure Platform best practices by ericnelWindows Azure Platform best practices by ericnel
Windows Azure Platform best practices by ericnel
 
Windows Azure Platform: Articles from the Trenches, Volume One
Windows Azure Platform: Articles from the Trenches, Volume OneWindows Azure Platform: Articles from the Trenches, Volume One
Windows Azure Platform: Articles from the Trenches, Volume One
 
Looking at the clouds through dirty windows
Looking at the clouds through dirty windows Looking at the clouds through dirty windows
Looking at the clouds through dirty windows
 
SQL Azure Overview for Bizspark day
SQL Azure Overview for Bizspark daySQL Azure Overview for Bizspark day
SQL Azure Overview for Bizspark day
 
Building An Application For Windows Azure And Sql Azure
Building An Application For Windows Azure And Sql AzureBuilding An Application For Windows Azure And Sql Azure
Building An Application For Windows Azure And Sql Azure
 
Entity Framework 4 In Microsoft Visual Studio 2010
Entity Framework 4 In Microsoft Visual Studio 2010Entity Framework 4 In Microsoft Visual Studio 2010
Entity Framework 4 In Microsoft Visual Studio 2010
 
Windows Azure In 30mins for none technical audience
Windows Azure In 30mins for none technical audienceWindows Azure In 30mins for none technical audience
Windows Azure In 30mins for none technical audience
 
Dev305 Entity Framework 4 Emergency Slides
Dev305 Entity Framework 4 Emergency SlidesDev305 Entity Framework 4 Emergency Slides
Dev305 Entity Framework 4 Emergency Slides
 
Design Considerations For Storing With Windows Azure
Design Considerations For Storing With Windows AzureDesign Considerations For Storing With Windows Azure
Design Considerations For Storing With Windows Azure
 
Windows Azure Overview
Windows Azure OverviewWindows Azure Overview
Windows Azure Overview
 
SQL Data Service Overview
SQL Data Service OverviewSQL Data Service Overview
SQL Data Service Overview
 
SQL Server 2008 Overview
SQL Server 2008 OverviewSQL Server 2008 Overview
SQL Server 2008 Overview
 

Recently uploaded

Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Vladimir Iglovikov, Ph.D.
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
Alex Pruden
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
ThomasParaiso2
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 

Recently uploaded (20)

Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 

Entity Framework Overview

  • 1. Eric Nelson Developer & Platform Group Microsoft Ltd eric.nelson@microsoft.com http://geekswithblogs.net/IUpdateable http://twitter.com/ericnel
  • 2. Accessing data in 1990 • ODBC, embedded SQL Accessing data in 2000 • ADO, Stored Procedures Accessing data in 2005 • ADO.NET, Datasets, DataReaders Accessing data in 2010 • ORM baby!
  • 3. What is it? an Abstraction technique for working with relational tables as if they were objects in memory Intention is to hide away the complexity of the underlying tables and give a uniform way of working with data Why use it? Developer productivity Retain database independence Note: Using an ORM does not mean you must use the ORM!
  • 4. Many ORMs out there LLBLGen Pro http://www.llblgen.com/ Nhibernate http://www.hibernate.org/343.html EntitySpaces http://www.entityspaces.net/Portal/Default.aspx Open Access http://www.telerik.com/products/orm.aspx DevForce http://www.ideablade.com/ XPO http://www.devexpress.com/Products/NET/ORM/ Lightspeed http://www.mindscape.co.nz/products/LightSpeed/default.aspx Plus many, many more No clear “winner” = relatively little adoption of ORM Developers waiting on Microsoft Of 31 .NET ORMs in 2003, 9 lasted to 2008
  • 5. Typed Datasets (cough) – shipped  ObjectSpaces “v1” – never shipped  ObjectSpaces “v2” – never shipped  Microsoft Business Framework – never shipped  WinFS – never shipped  LINQ to SQL - shipped November 2007  Visual Studio 2008 & .NET Framework 3.5 LINQ to Entities - shipped August 2008  Visual Studio 2008 SP1 & .NET Framework 3.5 SP1 Note: LINQ to Entities is the most visible part of the ADO.NET Entity Framework
  • 6. Entity Framework and LINQ to Entities is our strategic technology Entity Framework v2 in VS2010 and .NET Framework 4.0 Best of LINQ to SQL moves into LINQ to Entities Microsoft is using it Data Services - shipping Reporting Services Microsoft “M” Partners supporting it Database Vendors – IBM,OpenLink, Data Direct, Devart etc ORM vendors supporting it DevForce now target Entity Framework, replacing their own LLBLGen v3 will target Entity Framework as well as their own It is not just about ORM
  • 7. What is LINQ? LINQ is not about databases, it is about objects LINQ = Language-Integrated Query Extensions to programming languages to query objects in memory Why use it? Productivity!!! LINQ rocks www.linqpad.net We ship LINQ to Objects LINQ to XML LINQ to Datasets LINQ to SQL – just SQL Server LINQ to Entities – added in .NET Framework 3.5 SP1 Others make LINQ to Flickr etc
  • 9. LINQ to SQL LINQ to Entities Database Support SQL Server SQL Server, DB2, Oracle, Sybase, MySQL ... Object Relational Simple Complex Mapping Capabilities Not strategic  Status Strategic Often  Annoying Rarely
  • 10. Entity Framework is not just about ORM Entity Framework v1 is being adopted Typically on applications expected to “live” a long time Entity Framework is only .NET 3.5 SP1 and above Entity Framework is probably not the best choice for a “short lived” SQL Server applications Entity Framework v1 has “warts” Designer It is annoying – buggy, clunky Exposes subset of the functionality Does not support model first N-tier story Stored Procedure Support Foreign Keys PoCo Guids SQL 2008 New Types
  • 11. “EF is still cutting development time “the entity framework in half. Ya gotta can kiss my damn love it.” ass - this shit is ridiculous”
  • 12.
  • 13. What is it? Tools and services to create an Entity Data Model EDM gives ORM to SQL Server, Oracle, DB2 etc Tools and services for consuming an Entity Data Model Why use it? Productivity Complex mapping between entities and database tables Works great with ADO.NET Data Services Notes Strategic but just released...
  • 14. Entity Data Model Application model Mapped to a persistence store Conceptual Comprised of three layers: Conceptual (CSDL) Mapping (MSL) Mapping Storage (SSDL) Database agnostic Comprised of: Storage Entities Associations Functions
  • 15. { A look at mapping }
  • 16. 2 1 The ORM - optional Object Services 3 Entity Client
  • 17. Familiar ADO.NET object model: EntityCommand EntityConnection EntityDataReader EntityParameter EntityTransaction Text-based results Read-only Uses Entity SQL
  • 18. Queries materialized as Objects ObjectContext ObjectQuery<T> Built on top of Entity Client Two query options: Entity SQL LINQ Runtime services: Unit of work Identity tracking Eager/explicit loading
  • 20. ORM is an abstraction layer about data • Productivity • Database Independence Microsoft has two ORMs • LINQ to SQL – only SQL Server • Entity Framework (includes LINQ to Entities) – many RDBMS, strategic ADO.NET Entity Framework includes all the other bits  • EDM, Linq to Entities, ESQL, Object Services • Part of .NET Framework 3.5 SP1 Entity Data Model – mapping from conceptual to store • CSDL = Conceptual Schema Definition Language • SSDL = Store Schema Definition Language • MSDL = Mapping Schema Definition Language Two query languages • ESQL = Entity SQL. Read only query language similar to SQL • LINQ to Entities = Language Integrated Query to the EDM
  • 21. • .NET Framework 4.0 Entity Framework v2 • http://blogs.msdn.com/efdesign Entity Framework • Across MS Products and Technologies more widely adopted • Reporting Services vNext • Better ORM capabilities in LINQ to Entities Rough edges • POCO support, N-Tier, Model First removed Technologies work • e.g. ASP.NET Dynamic Data and Entity Framework better together • Less xml editing during development Better tooling
  • 22. 1990 to • Data Access technology remained reasonably static 2007 - • Procedural, API access • Surfaced the database schema Tables • No clear ORM choice • LINQ – excellent addition to the .NET 2008 – languages • Entity Framework and the EDM – strategic Objects investment • Productivity leap
  • 24. © 2008 Microsoft Ltd. 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.

Editor's Notes

  1. Estimated Time: 6 minutesTalking Points: When we talk about the Entity Framework, we’re actually talking about two things: The Entity Data Model (EDM) The Entity Framework It’s important to delineate the two as separate, but complementing technologies The EDM is a set of layers that make up your application’s model, as well as it’s mapping to an underlying data store. Made up of three files: CSDL (Conceptual Schema Definition Language) MSL (Mapping Specification Language) SSDL (Storage Schema Definition Language) This separation of concerns allows great flexibility: Model your application the way you want regardless of the state/structure of its underlying data store Normalize your database as much as you need without worrying about affecting the interface of the application’s object model The EDM represents a re-useable application model that can be leveraged from within many applications/environments and persisted across numerous databases. The Entity Data Model is RDMS agnostic, and numerous database vendors are currently developing providers: Oracle, DB2, MySQL, PostgreSQL, VistaDB, SQLite, Sybase, Informix, etc. The Entity Data Model primarily of three main concepts: Entities, which represent your domain objects. Associations, which represent a relationship between two entities. Functions, which represent stored procedures or UDFs in your database that can be mapped to model-level functionality. Because there will be plenty of situations where you’ll need to use stored procedures, the Entity Data Model allows you to map functions in your model to a store procedure in your database. This is useful because you can leverage a stored procedure without having to write ADO.NET code to call it, you can simply call a function on your model. EDM functions are represented as methods on your ObjectContext class.
  2. Estimated Time: 3 minutesTalking Points: This diagram helps to illustrate how each of the Entity Framework’s query options relate to each other. At the core of it all is the database-specific provider. This layer is what translates the query into the SQL flavor required for the underlying data source. Above that is the Entity Client API, which takes the Entity Framework query and passes in down to the database specific provider. If you want to use the Entity Client API directly, you see that you’re only query option is Entity SQL, and because it sits below Object Services, you don’t get any of its benefits. If you want to materialize your queries as objects, and get things like change tracking, identity mapping, relationship loading, etc. then you would use object services, that delegates its queries down to the Entity Client layer. When using Object Services you can leverage both Entity SQL and LINQ to make your queries.
  3. Estimated Time: 4 minutesTalking Points: The Entity Client is an Entity Framework “port” of the familiar object model of classes used in traditional ADO.NET programming, including:EntityCommandEntityConnectionEntityConnectionStringBuilderEntityDataReaderEntityParameterEntityTransaction Because of this fact it makes it a prime choice for developers migrating to the Entity Framework from ADO.NET. Just like traditional ADO.NET, your queries are returned as sequential text-based data that can iterated over using an EntityDataReader. This is great for performance, but lacks the rich object model that was created as part of your EDM. Entity Client gives you read-only access to your EDM. If data modification is required, you’ll have to use Object Services, which we’ll talk about in a bit. When using Entity Client, your queries are written using Entity SQL, which we’ll talk about in the next slide.
  4. Estimated Time: 5 minutesTalking Points: While the Entity Client API is great and performant, it lacks the use of our created object model, as well as the ability to update data in our model. The Object Services API sits on top of Entity Client, and provides object materialization on top of our queries. This means that instead of getting text-based results, we get back a collection of CLR objects that we can easily work with. The two mains components of the Object Services taxonomy are: ObjectContext, and ObjectQuery<T>ObjectContext is equivalent to an EntityConnection, and is what manages our connection to the EDM as well as provides crucial services for working with our data.ObjectQuery is equivalent to an EntityCommand and represents a single query executed against our EDM, that is manifested back as strongly-typed objects. Object Services allows you to write queries using two flavors: Entity SQL LINQ To Entities The same Entity SQL queries you would write using Entity Client can be leveraged with Object Services, but with the added benefits you get with the higher abstraction level (i.e. object materialization). While Entity SQL is great for scenarios that require a dynamic query, or greater control over your query’s shape, you’re still working with a string that is error-prone. In addition to Entity SQL, Object Services allows you to write your queries against it in LINQ which provides you with strong-typing, error-checking, and a higher level of abstraction from Entity SQL. If you are already familiar with LINQ, then you don’t have to master Entity SQL in order to query an EDM, because LINQ To Entities will make the translation for you. In addition to object materialization, object services provides you with other benefits/services: Unit of work Your Object Context represents your unit of work, which aggregates all changes made to all entities attached/contained in it, so that when you want to push those changes back to the server, you can do so in a single batch. Identity tracking The ObjectContext keeps track of the entities you’ve queried for by key, so that if you later request the same entity (by key), using the same ObjectContext instance, it will return you the instance it already has instead of re-hitting the database. Eager/explicit loading The Entity Framework doesn’t pre-load any relationship properties for you. If you want to query an entity as well as some of it’s related entities, you’ll need to explicitly request that by performing a “span” using the Include method of the ObjectQuery<T> class. Alternatively you can call the Load method on your entity’s relationship property.
  5. LINQ has two syntaxesLambda/Method Syntax = customer.Select(...)Comprehension/Query Syntax = from c in customer ...