Tuesday, December 6, 2016

WCF Data Access Layer

Entity Framework
It's an Object Relational Mapping (ORM) Tool.

  • Communicate with Database
  • Map database data to object-oriented data.

Entity Framework 3 Approach

Database First approach 
Create database with tables, columns, relations etc. and Entity framework will generate Model classes (Business entities) and Data Access Layer code.

Model First approach
Model classes and relationship between them will be defined manually using Model designer in Visual studio, and Entity Framework will generate Data Access Layer and Database with tables, columns, relations automatically.


Code First approach 
Manually POCO classes (simple .NET classes) will be created. Relationship between those classes will be defined by means of code.When the application executes for the first time Entity framework will generate Data Access Layer and Database with tables, columns and relations automatically in the database server.


DBSet
The collection of all the entities that query from the database.

No comments:

Post a Comment