Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
EESTEC Summer School 2012 - Entity Framework - Erni Durdevic
1.
2. Sql data access (Classic style)
SQL String: «SELECT x, y FROM TblPoints»
Entity Framework
3. Sql data access with EF
Entity Framework
takes care of the
DB interactions
and makes it
easy to access
relational data.
LINQ «SQL»
Entity
Framework
4. What is the Model?
Farm Model
Farm
Pig
s
Ducks
Rabbits
7. EF Model
Database-First
Farm DB Farm Model
Code-first
Farm Model Farm DB
8. EF –DB first
DB First
When you have a ready DB
and you want to access the
existing data
If you better prefer to build
the database first, and
automatically create the
model
9. EF –DB first
Demo:
› Create a DB
› Import it in into Visual Studio
› See what has been generated
EDMX
Mappings
C#
Class diagram
10. EF –Model first
Model First
› When you are building a new
solution from scratch
(New approach)
11. EF –Model first
Demo...
› Create the model
› Create an empty DB
› Generate the DB schema
12. EF –Model first
Demo
› Reference the Entity solution in a
separate project
Add reference
Copy the connection string
Reference System.Data.Entity
› Query data with LINQ
Select
Update
Insert
Delete