290 likes | 486 Views
Mike Taulty Developer & Platform Group Microsoft UK Mike.Taulty@microsoft.com http://www.miketaulty.com. ADO.NET Entity Framework. Entity Framework – Key Facts. Extension to the ADO.NET Provider Model Pluggable to support any database Functionality
E N D
Mike Taulty Developer & Platform Group Microsoft UK Mike.Taulty@microsoft.com http://www.miketaulty.com ADO.NET Entity Framework
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
ADO.NET Entity Framework ADO.NET API ORM API Entity Provider Connection ObjectContext Command ObjectQuery Conceptual Model DataReader Map Store Model SQL Provider Oracle Provider ...
ADO.NET Entity Framework ADO.NET API ORM API Entity Provider Conceptual Model Map Store Model SQL Provider Oracle Provider ...
Key Classes provider Connection Metadata CSDL MSL SSDL State Management CRUD
ADO.NET Entity Framework ADO.NET API ORM API Entity Provider Conceptual Model Map Store Model SQL Provider Oracle Provider ...
ADO.NET Entity Framework ADO.NET API ORM API Entity Provider Conceptual Model Map Store Model SQL Provider Oracle Provider ...
Resources • New Data Developer Site • http://www.datadeveloper.net • ADO.NET Team Blog • http://blogs.msdn.com/adonet • My website • http://www.miketaulty.com ( search Entity )
Mike Taulty Developer & Platform Group Microsoft UK Mike.Taulty@microsoft.com http://www.miketaulty.com ADO.NET Entity framework
Provider Specific (PL/SQL) “SELECT * FROM CUSTOMERS” ADO.NET Today App Code ADO.NET Command Providers Execute SQL Server DataReader Oracle Oracle Customers Customers Customers ...
ADO.NET Entity Framework Conceptual Model Map Customers UKCustomer UKPremiumCustomer
Provider Agnostic (ESQL) “SELECT * FROM UKCUSTOMER” ADO.NET Entity Framework App Code ADO.NET Conceptual Model Map Entity Provider Command Execute DataReader UKCustomer UKCustomer UKPremiumCustomer Customers UKCustomer Providers* SQL Server Oracle Oracle ...
ADO.NET Entity Framework EF EF .NET Entity Provider (Entity SQL) Programming Model EF Entity Data Model (CSDL) Conceptual Model LINQ Reader Connection Command Entity Entity Object Relational Mapping relationship Mapping (MSL) V2.0 Store Model (SSDL) .NET Data Provider Store Reader Connection Adapter Command
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
Mapping Examples ( 1 – Splitting ) Mapping Store Entities Type=“G” Customers Good Customers CustomerId ID First FirstName Last LastName Type Bad Customers ID ForeName Type=“B” Surname
Mapping Examples ( 2 – TPH ) Store Mapping Entities Customer Customers CustomerId ID First FirstName Last LastName ? IsPremium Overdraft AccountManager PremiumCustomer Overdraft AccountManager * Framework also supports TPT
Mapping Examples ( 3 – View + SPs ) Store Mapping Entities UkCustomer ClientView1 CustomerId select c.id, c.name from customers c where c.country = ‘UK’ Name p_DeleteUkCustomer p_UpdateUkCustomer p_InsertUkCustomer
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 Programming with LINQ to Entities