ADO NET Entity Framework
ADO NET Entity Framework
Entity Framework
Introduction
Exploring the Entity
Data Model
Querying and
Manipulating Entity
Data Models
Customizing Entity
Data Models Examples
EF4
Summary
Relational
Database
Conceptual /
Business Model
(Objects)
Entity Framework
Introduction
Exploring the Entity
Data Model
Querying and
Manipulating Entity
Data Models
Customizing Entity
Data Models Examples
EF4
Summary
Designer Window:
Graphical representation of an EDM and its
members
Enables adding more features to the model
Enables properties configuration
Enables updating from the data store
Enables model validation
Entity Framework
Introduction
Exploring the Entity
Data Model
Querying and
Manipulating Entity
Data Models
Customizing Entity
Data Models Examples
EF4
Summary
The image is
taken from
Julia Lermans
book
Programming
Entity
Framework,
1st Edition
LINQ to
Entities
Entity SQL
with Object
Services
Entity SQL
withEntity
Client
LINQ support
IntelliSense
Model dynamic
queries
Return type
Objects
Objects or
DbDataRecords
DbDataReader
Performance
Copyright SELA software & Education Labs Ltd. 14-18 Baruch Hirsch St.Bnei Brak 51202 Israel
www.sela.co.il
Add entity
By Assignment to an existing entitys property
By adding to a EntityCollection using Add method
Use ObjectContext AddTo methods
course.Department = department;
department.Courses.Add(course);
context.AddToCourses(course);
Entity Framework
Introduction
Exploring the Entity
Data Model
Querying and
Manipulating Entity
Data Models
Customizing Entity
Data Models Examples
EF4
Summary
Entity Framework
Introduction
Exploring the Entity
Data Model
Querying and
Manipulating Entity
Data Models
Customizing Entity
Data Models Examples
EF4
Summary
Database
First (v1)
Model
First (v4)
Entity Data
Model
Entity Data
Model
VS.
1) 1:1 DB Mapping
2) Could get crowded
3) No designer support
on V1
Class Definition
Everything
Navigation Property Definition
Scalar Property Definition
Get Product
2) Access
Category
Get Category
3) Get Category
2) Access
Category
Get Product
Get Category
Implicit
1) Get Product
Explicit
1) Get Product
In theory this
This
is perfect!
looks
really
good
Entity SQL
Block
1) Get Product
Web Service
2) Update Product
2) Make
Changes
Combines power of:
1)DataSet
2)DTOs
Entity Framework
Introduction
Exploring the Entity
Data Model
Querying and
Manipulating Entity
Data Models
Customizing Entity
Data Models Examples
EF4
Summary
My Blog:
http://blogs.microsoft.co.il/blogs/gilf