SlideShare a Scribd company logo
Eric Nelson
Developer & Platform Group
Microsoft Ltd
eric.nelson@microsoft.com
http://geekswithblogs.net/IUpdateable
http://twitter.com/ericnel
ORMs
  Swift look at history and future of ORM on
  Windows
Entity Framework – with demos
  Entity Data Model
  Entity Services
  Object Services
Entity Framework v2 – with no demos
  Overview of POCO, Model First etc
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, DataDirect, 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
      Devart Entity Developer

It is not just about ORM
{ 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”
Tools and services to create an Entity
Data Model (EDM)
Tools and services for consuming an
Entity Data Model
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 over 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, Entity 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
For Everyone
     Pluralization
     Foreign Keys
     Stored Procedures
     Self tracking Entities
 For the Model Centric Developer
     Model First
     Complex Types
     Model Defined Functions
 For the Control Freak
     Code Generation
 For the Agilist
     Persistence Ignorance, Lazy Loading, Code Only
 + “Other stuff”

Warning – not final. Expect changes!
Pluralization
  Used in Database First and Model First
  Implementation
    Public abstract PluralizationService
    Default implementation is English Only
    Default rules:
      EntityTypes / ComplexTypes are singularized
      EntitySets are pluralized
      Navigation Properties based on cardinality
Foreign Keys
  Independent Association – v1
    Product p = new Product
    {
         ID = 1,
          Name = quot;Bovrilquot;,
          Category = context.Categories
                            .Single(c => c.Name == quot;Foodquot;)
    };
    context.SaveChanges();

  FK Association – v2
    Product p = new Product
    {
        ID = 1,
        Name = quot;Bovrilquot;,
        CategoryID = 13
    };
    context.Products.AddObject(p);
    context.SaveChanges();
Stored Procedures
  Stored Procedures as functions
    Mapping support for stored procedure result
    Complex type as return type
    Scalar and void return type
  Entity CUD using Stored Procedures
    No need to have SPs for all CUD
Entities do their own change tracking
   regardless of which tier changes are made on
Somewhere between DTOs and DataSets
Model First
   Start with a blank model
   Add entities/relationships (CSDL)
   Click “Create Database from
   Model”
      Infer Storage Model (SSDL)
      Infer Mapping (MSL)
      Infer DDL
      Deploy DDL
   Modify and re-apply. Two way.
      But - deletes your data!!!
Complex Types
  Map a new type to many types
  Adds designer support
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(quot;MyModelquot;, quot;CustomerFullNamequot;)]
 public static string FullName(this customer c)
 {
    return String.Format(quot;{0} {1}quot;, c.FirstName, c.LastName);
 }

Enables Console.WriteLine(c.FullName());
In V1 we had EntityClassGenerator which
could be configured using events
  Hard (it used CodeDom)
  Inflexible (not much control)
In V2 we will have
  TemplatedEntityClassGenerator and will ship
  default T4 templates
  Customization via Tools
Uses Workflow Foundation
Persistence Ignorance
  Support for Plain Old CLR Objects
  No requirement to have specific interface, base
  class
Lazy Loading
  Can not do order.order_details.Load()
  But
  Can do lazy load
    Context.deferredloading=true
Code Only
  No XML files, no model!
  Convention to config
    E.g. Convention: xxxID to a primary
    key, schema=dbo
    E.g. Config: On map to schema sys and class
    property to table column

    [TableMapping(Schema=“sys”,TableName=“MyDBTable”]
    [ColumnMapping(PropertyName=“MyClassProp1”, Column
      Name=“table_column1”)]
    [Key(PropertyName=“MyClassProp1”)]
    public objectset<MyThing> MyThings...
Improved N-Tier API
More LINQ query operators
More SQL generation optimizations
Inline functions in ESQL
Readonly mapping
1990 to   • Data Access technology remained
            reasonably static
2008 -    • Procedural, API access
          • Surfaced the database schema
Tables    • No clear ORM choice



          • LINQ – excellent addition to the .NET
2009 –      languages
          • Entity Framework and the EDM – strategic
Objects     investment
          • Productivity leap
http://blogs.msdn.com/efdesign
  Entity Framework v2

http://geekswithblogs.net/IUpdateable
  Slides

Sessions Thursday on
  SQL Data Services 9:30am
  Windows Azure 2:00pm
© 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.
Driven by Reporting Services team + others
Query Tree Writing with no objects...
   LINQ query without objects...
   DbExpression expression=ctx.EntitySet(quot;Ordersquot;).Scan().Where(...);
   DbDataReader reader = ctx.ExecuteQuery(expression);


   Or

   from c in ctx.EntitySet(“Orders”).Scan()
   Select c.Property(“ShipCity”)

Readonly mapping
<EntityContainerMapping CdmEntityContainer=quot;CContainerquot;
    StorageEntityContainer=quot;SContainerquot; GenerateUpdateViews=quot;falsequot; >

More Related Content

What's hot

Dao example
Dao exampleDao example
Dao example
myrajendra
 
Hibernate Developer Reference
Hibernate Developer ReferenceHibernate Developer Reference
Hibernate Developer Reference
Muthuselvam RS
 
Entity Framework: Nakov @ BFU Hackhaton 2015
Entity Framework: Nakov @ BFU Hackhaton 2015Entity Framework: Nakov @ BFU Hackhaton 2015
Entity Framework: Nakov @ BFU Hackhaton 2015
Svetlin Nakov
 
Hibernate
HibernateHibernate
Hibernate
Ajay K
 
Introduction to JPA and Hibernate including examples
Introduction to JPA and Hibernate including examplesIntroduction to JPA and Hibernate including examples
Introduction to JPA and Hibernate including examples
ecosio GmbH
 
Hibernate tutorial
Hibernate tutorialHibernate tutorial
Hibernate tutorial
Mumbai Academisc
 
LINQ to Relational in Visual Studio 2008 SP1
LINQ to Relational in Visual Studio 2008 SP1LINQ to Relational in Visual Studio 2008 SP1
LINQ to Relational in Visual Studio 2008 SP1
ukdpe
 
Free Hibernate Tutorial | VirtualNuggets
Free Hibernate Tutorial  | VirtualNuggetsFree Hibernate Tutorial  | VirtualNuggets
Free Hibernate Tutorial | VirtualNuggets
Virtual Nuggets
 
Hibernate tutorial for beginners
Hibernate tutorial for beginnersHibernate tutorial for beginners
Hibernate tutorial for beginners
Rahul Jain
 
Spring (1)
Spring (1)Spring (1)
Spring (1)
Aneega
 
Introduction to Hibernate Framework
Introduction to Hibernate FrameworkIntroduction to Hibernate Framework
Introduction to Hibernate Framework
Raveendra R
 
Hibernate ppt
Hibernate pptHibernate ppt
Hibernate ppt
Aneega
 
Hibernate presentation
Hibernate presentationHibernate presentation
Hibernate presentation
Manav Prasad
 
MobiConf 2018 | Room: an SQLite object mapping library
MobiConf 2018 | Room: an SQLite object mapping library MobiConf 2018 | Room: an SQLite object mapping library
MobiConf 2018 | Room: an SQLite object mapping library
Magda Miu
 
Basic Java Database Connectivity(JDBC)
Basic Java Database Connectivity(JDBC)Basic Java Database Connectivity(JDBC)
Basic Java Database Connectivity(JDBC)
suraj pandey
 
Oracle Sql Developer Data Modeler 3 3 new features
Oracle Sql Developer Data Modeler 3 3 new featuresOracle Sql Developer Data Modeler 3 3 new features
Oracle Sql Developer Data Modeler 3 3 new features
Philip Stoyanov
 
ORM Concepts and JPA 2.0 Specifications
ORM Concepts and JPA 2.0 SpecificationsORM Concepts and JPA 2.0 Specifications
ORM Concepts and JPA 2.0 Specifications
Ahmed Ramzy
 

What's hot (20)

Dao example
Dao exampleDao example
Dao example
 
Hibernate Developer Reference
Hibernate Developer ReferenceHibernate Developer Reference
Hibernate Developer Reference
 
Hibernate in Action
Hibernate in ActionHibernate in Action
Hibernate in Action
 
Entity Framework: Nakov @ BFU Hackhaton 2015
Entity Framework: Nakov @ BFU Hackhaton 2015Entity Framework: Nakov @ BFU Hackhaton 2015
Entity Framework: Nakov @ BFU Hackhaton 2015
 
Hibernate
HibernateHibernate
Hibernate
 
Introduction to JPA and Hibernate including examples
Introduction to JPA and Hibernate including examplesIntroduction to JPA and Hibernate including examples
Introduction to JPA and Hibernate including examples
 
Hibernate tutorial
Hibernate tutorialHibernate tutorial
Hibernate tutorial
 
LINQ to Relational in Visual Studio 2008 SP1
LINQ to Relational in Visual Studio 2008 SP1LINQ to Relational in Visual Studio 2008 SP1
LINQ to Relational in Visual Studio 2008 SP1
 
Free Hibernate Tutorial | VirtualNuggets
Free Hibernate Tutorial  | VirtualNuggetsFree Hibernate Tutorial  | VirtualNuggets
Free Hibernate Tutorial | VirtualNuggets
 
Hibernate tutorial for beginners
Hibernate tutorial for beginnersHibernate tutorial for beginners
Hibernate tutorial for beginners
 
Spring (1)
Spring (1)Spring (1)
Spring (1)
 
Introduction to Hibernate Framework
Introduction to Hibernate FrameworkIntroduction to Hibernate Framework
Introduction to Hibernate Framework
 
Hibernate ppt
Hibernate pptHibernate ppt
Hibernate ppt
 
JPA and Hibernate
JPA and HibernateJPA and Hibernate
JPA and Hibernate
 
Jdbc
JdbcJdbc
Jdbc
 
Hibernate presentation
Hibernate presentationHibernate presentation
Hibernate presentation
 
MobiConf 2018 | Room: an SQLite object mapping library
MobiConf 2018 | Room: an SQLite object mapping library MobiConf 2018 | Room: an SQLite object mapping library
MobiConf 2018 | Room: an SQLite object mapping library
 
Basic Java Database Connectivity(JDBC)
Basic Java Database Connectivity(JDBC)Basic Java Database Connectivity(JDBC)
Basic Java Database Connectivity(JDBC)
 
Oracle Sql Developer Data Modeler 3 3 new features
Oracle Sql Developer Data Modeler 3 3 new featuresOracle Sql Developer Data Modeler 3 3 new features
Oracle Sql Developer Data Modeler 3 3 new features
 
ORM Concepts and JPA 2.0 Specifications
ORM Concepts and JPA 2.0 SpecificationsORM Concepts and JPA 2.0 Specifications
ORM Concepts and JPA 2.0 Specifications
 

Similar to Entity Framework v1 and v2

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
 
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
 
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
 
What's New for Data?
What's New for Data?What's New for Data?
What's New for Data?ukdpe
 
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
 
ADO.NET Entity Framework DevDays
ADO.NET Entity Framework DevDaysADO.NET Entity Framework DevDays
ADO.NET Entity Framework DevDays
ukdpe
 
70487.pdf
70487.pdf70487.pdf
70487.pdf
Karen Benoit
 
Microsoft Entity Framework
Microsoft Entity FrameworkMicrosoft Entity Framework
Microsoft Entity Framework
Mahmoud Tolba
 
Concepts of Asp.Net
Concepts of Asp.NetConcepts of Asp.Net
Concepts of Asp.Netvidyamittal
 
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
 
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
 
Linq 1224887336792847 9
Linq 1224887336792847 9Linq 1224887336792847 9
Linq 1224887336792847 9google
 
Data Driven WPF and Silverlight Applications
Data Driven WPF and Silverlight ApplicationsData Driven WPF and Silverlight Applications
Data Driven WPF and Silverlight ApplicationsDave Allen
 
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
 
Dot Net Fundamentals
Dot Net FundamentalsDot Net Fundamentals
Dot Net FundamentalsLiquidHub
 
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
 
Entity framework introduction sesion-1
Entity framework introduction   sesion-1Entity framework introduction   sesion-1
Entity framework introduction sesion-1
Usama Nada
 
Linq To The Enterprise
Linq To The EnterpriseLinq To The Enterprise
Linq To The EnterpriseDaniel Egan
 
Data Access Tech Ed India
Data Access   Tech Ed IndiaData Access   Tech Ed India
Data Access Tech Ed Indiarsnarayanan
 

Similar to Entity Framework v1 and v2 (20)

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
 
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)
 
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)
 
What's New for Data?
What's New for Data?What's New for Data?
What's New for Data?
 
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
 
ADO.NET Entity Framework DevDays
ADO.NET Entity Framework DevDaysADO.NET Entity Framework DevDays
ADO.NET Entity Framework DevDays
 
70487.pdf
70487.pdf70487.pdf
70487.pdf
 
Microsoft Entity Framework
Microsoft Entity FrameworkMicrosoft Entity Framework
Microsoft Entity Framework
 
Concepts of Asp.Net
Concepts of Asp.NetConcepts of Asp.Net
Concepts of Asp.Net
 
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
 
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
 
Linq 1224887336792847 9
Linq 1224887336792847 9Linq 1224887336792847 9
Linq 1224887336792847 9
 
Data Driven WPF and Silverlight Applications
Data Driven WPF and Silverlight ApplicationsData Driven WPF and Silverlight Applications
Data Driven WPF and Silverlight Applications
 
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
 
Dot Net Fundamentals
Dot Net FundamentalsDot Net Fundamentals
Dot Net Fundamentals
 
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
 
Entity framework introduction sesion-1
Entity framework introduction   sesion-1Entity framework introduction   sesion-1
Entity framework introduction sesion-1
 
Linq To The Enterprise
Linq To The EnterpriseLinq To The Enterprise
Linq To The Enterprise
 
Data Access Tech Ed India
Data Access   Tech Ed IndiaData Access   Tech Ed India
Data Access Tech Ed India
 

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
 
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 (18)

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
 
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

Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
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.
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
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
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
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
 
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
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
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
 
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
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
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.
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 

Recently uploaded (20)

Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
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
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
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
 
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
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
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...
 
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
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
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
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 

Entity Framework v1 and v2

  • 1. Eric Nelson Developer & Platform Group Microsoft Ltd eric.nelson@microsoft.com http://geekswithblogs.net/IUpdateable http://twitter.com/ericnel
  • 2. ORMs Swift look at history and future of ORM on Windows Entity Framework – with demos Entity Data Model Entity Services Object Services Entity Framework v2 – with no demos Overview of POCO, Model First etc
  • 3.
  • 4. 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!
  • 5. 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!
  • 6. 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
  • 7. 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
  • 8. 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, DataDirect, 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 Devart Entity Developer It is not just about ORM
  • 10. 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
  • 11. 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
  • 12. “EF is still cutting development time “the entity framework in half. Ya gotta can kiss my damn love it.” ass - this shit is ridiculous”
  • 13.
  • 14. Tools and services to create an Entity Data Model (EDM) Tools and services for consuming an Entity Data Model
  • 15. 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
  • 16. { A look at mapping }
  • 17. 2 1 The ORM - optional Object Services 3 Entity Client
  • 18. Familiar ADO.NET object model: EntityCommand EntityConnection EntityDataReader EntityParameter EntityTransaction Text-based results Read-only Uses Entity SQL
  • 19. 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
  • 21. ORM is an abstraction layer over 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, Entity 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
  • 22.
  • 23. For Everyone Pluralization Foreign Keys Stored Procedures Self tracking Entities For the Model Centric Developer Model First Complex Types Model Defined Functions For the Control Freak Code Generation For the Agilist Persistence Ignorance, Lazy Loading, Code Only + “Other stuff” Warning – not final. Expect changes!
  • 24. Pluralization Used in Database First and Model First Implementation Public abstract PluralizationService Default implementation is English Only Default rules: EntityTypes / ComplexTypes are singularized EntitySets are pluralized Navigation Properties based on cardinality
  • 25. Foreign Keys Independent Association – v1 Product p = new Product { ID = 1, Name = quot;Bovrilquot;, Category = context.Categories .Single(c => c.Name == quot;Foodquot;) }; context.SaveChanges(); FK Association – v2 Product p = new Product { ID = 1, Name = quot;Bovrilquot;, CategoryID = 13 }; context.Products.AddObject(p); context.SaveChanges();
  • 26. Stored Procedures Stored Procedures as functions Mapping support for stored procedure result Complex type as return type Scalar and void return type Entity CUD using Stored Procedures No need to have SPs for all CUD
  • 27. Entities do their own change tracking regardless of which tier changes are made on Somewhere between DTOs and DataSets
  • 28. Model First Start with a blank model Add entities/relationships (CSDL) Click “Create Database from Model” Infer Storage Model (SSDL) Infer Mapping (MSL) Infer DDL Deploy DDL Modify and re-apply. Two way. But - deletes your data!!!
  • 29. Complex Types Map a new type to many types Adds designer support
  • 30. 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(quot;MyModelquot;, quot;CustomerFullNamequot;)] public static string FullName(this customer c) { return String.Format(quot;{0} {1}quot;, c.FirstName, c.LastName); } Enables Console.WriteLine(c.FullName());
  • 31. In V1 we had EntityClassGenerator which could be configured using events Hard (it used CodeDom) Inflexible (not much control) In V2 we will have TemplatedEntityClassGenerator and will ship default T4 templates Customization via Tools Uses Workflow Foundation
  • 32. Persistence Ignorance Support for Plain Old CLR Objects No requirement to have specific interface, base class Lazy Loading Can not do order.order_details.Load() But Can do lazy load Context.deferredloading=true
  • 33. Code Only No XML files, no model! Convention to config E.g. Convention: xxxID to a primary key, schema=dbo E.g. Config: On map to schema sys and class property to table column [TableMapping(Schema=“sys”,TableName=“MyDBTable”] [ColumnMapping(PropertyName=“MyClassProp1”, Column Name=“table_column1”)] [Key(PropertyName=“MyClassProp1”)] public objectset<MyThing> MyThings...
  • 34. Improved N-Tier API More LINQ query operators More SQL generation optimizations Inline functions in ESQL Readonly mapping
  • 35. 1990 to • Data Access technology remained reasonably static 2008 - • Procedural, API access • Surfaced the database schema Tables • No clear ORM choice • LINQ – excellent addition to the .NET 2009 – languages • Entity Framework and the EDM – strategic Objects investment • Productivity leap
  • 36. http://blogs.msdn.com/efdesign Entity Framework v2 http://geekswithblogs.net/IUpdateable Slides Sessions Thursday on SQL Data Services 9:30am Windows Azure 2:00pm
  • 37. © 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.
  • 38. Driven by Reporting Services team + others Query Tree Writing with no objects... LINQ query without objects... DbExpression expression=ctx.EntitySet(quot;Ordersquot;).Scan().Where(...); DbDataReader reader = ctx.ExecuteQuery(expression); Or from c in ctx.EntitySet(“Orders”).Scan() Select c.Property(“ShipCity”) Readonly mapping <EntityContainerMapping CdmEntityContainer=quot;CContainerquot; StorageEntityContainer=quot;SContainerquot; GenerateUpdateViews=quot;falsequot; >