Presentation is loading. Please wait.

Presentation is loading. Please wait.

ADO.NET ENTITY FRAMEWORK Mike Taulty Developer & Platform Group Microsoft UK

Similar presentations


Presentation on theme: "ADO.NET ENTITY FRAMEWORK Mike Taulty Developer & Platform Group Microsoft UK"— Presentation transcript:

1

2 ADO.NET ENTITY FRAMEWORK Mike Taulty Developer & Platform Group Microsoft UK Mike.Taulty@microsoft.com http://www.miketaulty.com

3 Entity Framework – Key Facts Extension to the ADO.NET Provider Model –Pluggable to support any database Functionality –Abstracts a model from your store schema –Offers Object Relational Mapping/LINQ and ADO.NET APIs Status –Coming in Visual Studio 2008 Sp1, Summer 2008 –Currently in VS 2008 Sp1 Beta 1 3 previous independent betas

4 ADO.NET Entity Framework SQL Provider Oracle Provider... Entity Provider Conceptual Model Store Model Map ADO.NET API ORM API Connection Command DataReader ObjectContext ObjectQuery

5 ADO.NET Entity Framework SQL Provider Oracle Provider... ADO.NET API Entity Provider Conceptual Model Store Model Map ORM API

6 LINQ to SQL? LINQ to Entities? LINQ to SQLLINQ to Entities Database Support SQL ServerMany Object Relational Mapping Capabilities SimpleComplex Requires Attributed.NET Code NoYes StatusReleasedBeta

7 DEMO Programming Entity Framework with LINQ

8 Key Classes State Management State Management Connection provider Metadata MSL SSDL CSDL CRUD

9 LINQ to Entities – Lots of Topics Change Tracking ConcurrencyTransactions(i)POCO Stored Procs Inheritance Customising Code-Gen Metadata N-Tier Compiled Queries Performance

10 ADO.NET Entity Framework SQL Provider Oracle Provider... ADO.NET API ORM API Entity Provider Conceptual Model Store Model Map

11 DEMO Manipulating our Conceptual Model

12 ADO.NET Entity Framework SQL Provider Oracle Provider... ORM API Entity Provider Conceptual Model Store Model Map ADO.NET API

13 DEMO Programming with Entity SQL and ADO.NET

14 EF Providers in Progress VendorDB Support MicrosoftSQL Server Core LabOracle, MySQL, PostgreSQL, SQLite IBMDB2, Informix Dynamic Server MySQL ABMySQL NpgsqlPostgreSQL OpenLinkMany via OpenLink ODBC or JDBC PhoenixSQLite DataDirectOracle, Sybase, SQL Server, DB2 Firebird

15 Resources New Data Developer Site –http://www.datadeveloper.nethttp://www.datadeveloper.net ADO.NET Team Blog –http://blogs.msdn.com/adonethttp://blogs.msdn.com/adonet My website –http://www.miketaulty.com ( search Entity )http://www.miketaulty.com

16 ADO.NET ENTITY FRAMEWORK Mike Taulty Developer & Platform Group Microsoft UK Mike.Taulty@microsoft.com http://www.miketaulty.com

17

18 ADO.NET Today App Code Customers ADO.NETADO.NET ProvidersProviders SQL Server OracleOracle...... DataReaderDataReader Customers OracleOracle CommandCommand ExecuteExecute Provider Specific (PL/SQL) “SELECT * FROM CUSTOMERS” Customers

19 ADO.NET Entity Framework Customers Conceptual Model UKCustomer UKPremiumCustomer MapMap

20 ADO.NET Entity Framework App Code Customers ADO.NETADO.NET Providers*Providers* SQL Server OracleOracle...... OracleOracle EntityProviderEntityProvider DataReaderDataReader UKCustomer CommandCommand ExecuteExecute Conceptual Model UKCustomer UKPremiumCustomer MapMap Provider Agnostic (ESQL) “SELECT * FROM UKCUSTOMER” UKCustomer

21 .NET Entity Provider (Entity SQL) Command Connection Reader EF ADO.NET Entity Framework Store.NET Data Provider V2.0 Command Connection Reader Adapter EF Conceptual Model Entity relationship Store Model (SSDL) Store Model (SSDL) Entity Data Model (CSDL) Entity Data Model (CSDL) Mapping (MSL) EF Programming Model Object Relational Mapping LINQ

22 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 ANYELEMENTCREATEREFDEREFIS OFKEYMULTISETNAVIGATEOFTYPE OVERLAPSREFROWSELECTSETTREATUSING

23 DEMO Programming with Entity SQL

24 Mapping Examples ( 1 – Splitting ) Store Good Customers ID FirstName LastName Bad Customers ID ForeName Surname Customers CustomerId First Last Type EntitiesMapping Type=“G” Type=“B”

25 Mapping Examples ( 2 – TPH ) Store Customer CustomerId First Last EntitiesMapping Customers ID FirstName LastName IsPremium Overdraft AccountManager PremiumCustomer Overdraft AccountManager ? ? * Framework also supports TPT

26 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

27 DEMO Querying Different Models with Entity SQL

28 Programming with LINQ to Entities New Data Access ORM API implemented in assembly –System.Data.Entity.dll Many Namespaces –System.Data.Entity –System.Data.Objects –... Object Relational Mapping API can be used with or without LINQ

29 DEMO Programming with LINQ to Entities


Download ppt "ADO.NET ENTITY FRAMEWORK Mike Taulty Developer & Platform Group Microsoft UK"

Similar presentations


Ads by Google