ADO.NET Entity Framework

beansproutscompleteSoftware and s/w Development

Dec 13, 2013 (3 years and 10 months ago)

81 views

ADO.NET Entity Framework

Mike Taulty

Developer & Platform Group

Microsoft Ltd

Mike.Taulty@microsoft.com


http://www.mtaulty.com

ADO.NET Entity Framework

Extension to the ADO.NET provider model

Functionality

Program against an abstracted model of your
store schema

Use traditional ADO.NET API or ORM/LINQ

Slated to ship mid 2008

Currently at Beta 3, Tooling at CTP 2

Downloadable in
ASP.NET 3.5 Extensions Preview

Quick Demo to Defer Boredom

.NET Entity Provider (Entity SQL)

Command

Connection

Reader

V3.0

Entity Framework Architecture

Store

.NET Data Provider

V2.0

Command

Connection

Reader

Adapter

V3.0

Conceptual Model

Entity

Entity

relationship

Store Model

(SSDL)

Entity Data Model

(CSDL)

Mapping (MSL)

V3.0

Programming Model

Object Relational Mapping

LINQ

Tools, SSDL, MSL, CSDL

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

Programming with Entity Client

Mapping Examples ( 1


Splitting )

Store

Good Customers

ID

FirstName

LastName

Bad Customers

ID

ForeName

Surname

Customers

CustomerId

First

Last

Type

Entities

Mapping

Type=“G”

Type=“B”

Mapping Examples ( 2


TPH )

Store

Customer

CustomerId

First

Last

Entities

Mapping

Customers

ID

FirstName

LastName

IsPremium

Overdraft

AccountManager

PremiumCustomer

Overdraft

AccountManager

?

* Framework also supports TPT

Mapping Examples ( 3


View + SPs )

Store

UkCustomer

CustomerId

Name

Entities

Mapping

ClientView1

select


c.id, c.name

from


customers c

where


c.country

= ‘UK’

p_DeleteUkCustomer

p_UpdateUkCustomer

p_InsertUkCustomer

Querying with Entity SQL

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

and many more...

ORM API can be used with or without LINQ

Key Classes

State

Management

Connection

provider

Metadata

MSL

SSDL

CSDL

CRUD

LINQ to Entities


Possible Topics

Change
Tracking

Concurrency

Transactions

(
i
)POCO

Stored

Procs

Inheritance

Customising
Code
-
Gen

Metadata

N
-
Tier

Compiled
Queries

LINQ to Entities

Resources

Download
ASP.NET 3.5 Extensions Preview

http://www.asp.net


ADO.NET Team Blog

http://blogs.msdn.com/adonet


Search for “entity” on

http://mtaulty.com


Updates

Go here to download the latest version of this
slide
-
deck

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


MSDN in the UK

Visit
http://msdn.co.uk


Newsletter

Events

Screencasts

Blogs

© 2007 Microsoft Ltd. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered

tr
ademarks 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
dat
e 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 accu
rac
y 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.