introducing entity framework
DESCRIPTION
this is an introduction session about Microsoft Entity Framework 4.0TRANSCRIPT
Introducing Entity Framework
EF v1.0
History of ADO.Net
Object Relational Mapping {ORM}
What is Entity Framework?
Entity Framework Architecture
Entity Data Model {EDM}
Entity Client & Object Services
LINQ to Entities & Entity SQL {eSQL}
Agenda
Load Related Objects
Inheritance in Entity Framework
Entity Framework providers and multiple database support
Entity Framework Limitations
External Tools
References
Agenda (Cont.)
History of ADO .Net
•Object Oriented Datasets.
•Disconnected Model.
•Provider Abstraction.
2002ADO .Net v1.0
•Provider Factories•Metadata schema•Asynchronous Command Execution
•Conflict Detection•Batch Updates•Multiple Active Result Sets (MARS)
2005ADO .Net v2.0
•Nothing changed in ADO.net
2006ADO .Net v3.0
•Paging Support
•Synchronization APIs
•Language integrated Query (LINQ)
•LINQ to SQL
2007ADO .Net v3.5
•Entity Data Model (EDM)•Object Services•LINQ to Entities•Entity SQL•Entity Client•ADO .Net Data Services
2008ADO .Net v3.5
SP1
Object Relational Mapping
{ORM}
Definition
ORM & Visual Studio
External Tools & frameworks for .Net
ORM Basics & Concepts
What is Entity Framework?
Why it is considered an ORM?
What is Entity Framework?
An ORM framework, Why?
Database Independent
Extensible
Part of Microsoft .Net framework 3.5 SP1
Getting Started
Demo
Entity Framework Architecture
Entity Framework Architecture
Entity Data Model (EDM)
What is Entity Data Mode?
SSDL
MSL
CSDL
Entity Data Model (EDM)
EDM in Action
Demo
Entity Client & Object Services
Entity Client EntityClient Provider for Entity Framework
System.Data.EntityClient
Abstracts DBMS Providers for Entity Framework Architecture
Entity Client in Action
Demo
Object Context
Entity Contain
er
Object Services
Entity Connection
Object Services
Object Services in Action
Demo
Break (30 minutes)
LINQ to Entities & Entity SQL
LINQ to Entities What is LINQ
◦ LINQ to Objects◦ LINQ to XML◦ LINQ to DataSets◦ LINQ to SQL◦ And more E.g. (LINQ to Twitter, LINQ to Flickr
etc…)
LINQ to Entities
LINQ to Entities in Action
Demo
Entity SQL (eSQL)
Supported NOT Supported
SQL based
Provider neutral
Supports EDM types
First class collections
Canonical functions
DML statements (insert,
update, delete)
DDL statement (create,
alter, drop)
Grouping functions (CUBE,
ROLLUP, GROUPING_SET
Does not support the *
construct
Entity SQL in Action
Demo
Entity SQL Vs LINQ to Entities
Dynamic queries (LINQ is compiled)
Store Function/Procedures is only supported in eSQL
Load Related Objects
Entity relation mapping (one to one, one to many, many to many)
Deferred Loading Vs Eager Loading Vs Explicit Loading
ObjectQuery<T> Class
EntityCollection<T> Class
EntityReference Class
Load Related Objects
Load Related Objects in Action
Demo
Inheritance in Entity Framework
Inheritance in Entity Framework
Table-per-Hierarchy (TPH) Table-per-Type (TPT)
Table
Hierarchy
Table
Type
One table in storage to maintain data for all the types in an inheritance hierarchy.
Table-per-Hierarchy (TPH)
Separate table in storage to maintain data for each type in the inheritance hierarchy.
Table-per-Type (TPT)
Inheritance in Action
Demo
Entity Framework Providers
Multiple database support
Entity Framework Providers◦ MySQL Connector\net (MySQL)◦ Devart (Oracle, MySQL, SQLite and PostgreSQL)◦ IBM (DB2, Informix and U2 databases)◦ Phoenix Software Solutions (SQLite)◦ Npgsql (PostgreSQL)◦ Sybase SQL Anywhere (SQL Anywhere 11)◦ Firebird (Firebird)◦ VistaDB (VistaDB 4.x)
Multiple Database Support in Entity Framework
Multiple Database Support
Demo
Entity Framework Limitations
Known Issues and Considerations in LINQ to Entities◦ Ordering Information Lost◦ Nested Queries. Nested Queries May Fail with SQL
Server 2000◦ Unsigned Integers Not Supported◦ Enums not supported◦ Referencing Non-Scalar Closures Not Supported◦ Custom extension methods Not Supported◦ Some common sense methods not supported
(Single, SingleOrDefault)
Entity Framework Limitations
Entity Framework VS.Net Designer Limitations
limitations in Entity SQL◦ DDL not supported◦ DML not supported (insert, update, delete)
Design issues◦ No Persistence Ignorance support a.k.a POCO◦ Leakage of Testability
I am sure there might be more
Entity Framework Limitations (Cont.)
LINQPad eSQLBlast
◦ http://code.msdn.microsoft.com/esql/
External Tools
References
MSDN◦ Programming Guide (Entity Framework)◦ Load Related Objects (Entity Framework)◦ Inheritance in Entity Framework
TPH TPT
◦ Known Issues and Considerations in LINQ to Entities
◦ Entity Framework and LINQ to Entities Forums◦ ADO.NET Entity Framework and LINQ to Entities (P
re-Release) Forums
References
Community◦ Zeeshan Hirani Entity Framework Learning Guide
Post PDF
◦ Gil Fink on Entity Framework◦ Moses’ blog on Entity Framework◦ Entity Framework Supported Mapping Scenarios
White Paper by Asad Khan
References (Cont.)