entity framework ado.net

Download Entity Framework ADO.net

Post on 14-Apr-2018

230 views

Category:

Documents

0 download

Embed Size (px)

TRANSCRIPT

  • 7/30/2019 Entity Framework ADO.net

    1/19

    ADO.NET Entity Framework

    Mike Taulty

    Developer & Platform Group

    Microsoft [email protected]

    http://www.mtaulty.com

    mailto:[email protected]://www.website.com/http://www.website.com/mailto:[email protected]
  • 7/30/2019 Entity Framework ADO.net

    2/19

    ADO.NET Entity Framework

    Extension to the ADO.NET provider model

    Functionality

    Program against an abstracted model of yourstore schema

    Use traditional ADO.NET API or ORM/LINQ

    Slated to ship mid 2008

    Currently at Beta 3, Tooling at CTP 2Downloadable in ASP.NET 3.5 Extensions Preview

    http://www.asp.net/downloads/3.5-extensions/http://www.asp.net/downloads/3.5-extensions/
  • 7/30/2019 Entity Framework ADO.net

    3/19

    Quick Demo to Defer Boredom

  • 7/30/2019 Entity Framework ADO.net

    4/19

    .NET Entity Provider (Entity SQL)

    Command

    ConnectionReader

    V3.0

    Entity Framework Architecture

    Store.NET Data Provider

    V2.0

    Command

    ConnectionReader

    Adapter

    V3.0

    Conceptual Model

    Entity Entityrelationship

    Mapping (MSL)

    V3.0

    Programming Model

    Object Relational Mapping

    LINQ

  • 7/30/2019 Entity Framework ADO.net

    5/19

    Tools, SSDL, MSL, CSDL

  • 7/30/2019 Entity Framework ADO.net

    6/19

    Programming with Entity SQL

    The EntityClient provides the usual

    Connection, Command, DataReader

    There is no EntityDataAdapter

    V1.0 the model is read-only

    Entity SQL has some additional constructs to

    expose the underlying conceptual model e.g.;

    ANYELEMENT CREATEREF DEREF IS OF KEY MULTISET NAVIGATE OFTYPE

    OVERLAPS REF ROW SELECT SET TREAT USING

  • 7/30/2019 Entity Framework ADO.net

    7/19

    Programming with Entity Client

  • 7/30/2019 Entity Framework ADO.net

    8/19

    Mapping Examples ( 1 Splitting )

    Store

    Good Customers

    IDFirstName

    LastName

    Bad Customers

    ID

    ForeName

    Surname

    Customers

    CustomerId

    First

    Last

    Type

    EntitiesMapping

    Type=G

    Type=B

  • 7/30/2019 Entity Framework ADO.net

    9/19

    Mapping Examples ( 2 TPH )

    Store

    Customer

    CustomerIdFirst

    Last

    EntitiesMapping

    Customers

    ID

    FirstName

    LastName

    IsPremium

    Overdraft

    AccountManager PremiumCustomer

    Overdraft

    AccountManager

    ?

    * Framework also supports TPT

  • 7/30/2019 Entity Framework ADO.net

    10/19

    Mapping Examples ( 3 View + SPs )

    Store

    UkCustomer

    CustomerId

    Name

    EntitiesMapping

    ClientView1

    select

    c.id, c.name

    from

    customers c

    where

    c.country = UK

    p_DeleteUkCustomer

    p_UpdateUkCustomer

    p_InsertUkCustomer

  • 7/30/2019 Entity Framework ADO.net

    11/19

    Querying with Entity SQL

  • 7/30/2019 Entity Framework ADO.net

    12/19

    Programming with LINQ to Entities

    New Data Access ORM API implemented in

    assembly

    System.Data.Entity.dll

    System.Data.Entity.Design.dll

    Many Namespaces

    System.Data.Entity

    System.Data.Objectsand many more...

    ORM API can be used with or without LINQ

  • 7/30/2019 Entity Framework ADO.net

    13/19

    Key Classes

    State

    Management

    Connection

    provider

    Metadata

    MSL SSDLCSDL

    CRUD

  • 7/30/2019 Entity Framework ADO.net

    14/19

    LINQ to Entities Possible Topics

    ChangeTracking

    Concurrency Transactions (i)POCO

    Stored

    ProcsInheritance

    CustomisingCode-Gen

    Metadata

    N-TierCompiledQueries

  • 7/30/2019 Entity Framework ADO.net

    15/19

    LINQ to Entities

  • 7/30/2019 Entity Framework ADO.net

    16/19

    Resources

    Download ASP.NET 3.5 Extensions Preview

    http://www.asp.net

    ADO.NET Team Bloghttp://blogs.msdn.com/adonet

    Search for entity on

    http://mtaulty.com

    http://www.asp.net/downloads/3.5-extensions/http://www.asp.net/http://blogs.msdn.com/adonethttp://mtaulty.com/http://mtaulty.com/http://blogs.msdn.com/adonethttp://www.asp.net/http://www.asp.net/downloads/3.5-extensions/
  • 7/30/2019 Entity Framework ADO.net

    17/19

    Updates

    Go here to download the latest version of this

    slide-deck

    http://mtaulty.com/downloads/dw08.zip

    http://mtaulty.com/downloads/dw08.ziphttp://mtaulty.com/downloads/dw08.zip
  • 7/30/2019 Entity Framework ADO.net

    18/19

    MSDN in the UK

    Visit http://msdn.co.uk

    NewsletterEvents

    Screencasts

    Blogs

    http://msdn.co.uk/http://msdn.co.uk/
  • 7/30/2019 Entity Framework ADO.net

    19/19

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