Monday, 15 July 2013

Entity Framework - Introduction

        Entity Framework is an object or Relational mapping framework.using entity framework developers querying through Linq , It can retrieve and manipulate data as strongly typed objects.  It Provides services like Change Tracking, identity resoultion, lazy loading and query translations.

         It is the advancement of ADO.Net , That gives developers automated in storing and access the data from database.

ORM : Obect or Relational mapping
O/RM includes three main parts Domain Class Object, Relational database objects and Mapping information

How domain objects are mapped to Relational database objects It keeps separate the Relational database design from our Domain class design .It also automated Standarad  CRUD operations (create,read,update, delete)

There is a difference between Entity framework and LinqToSql , Entity framework supports all servers SqlServer, Oracle, DB2, MySql. In LinqToSql one class is mapped to one Table. In EF Domain class is mapped to multiple tables using inheritance like table per type(class) or  table per hierarchy of classes.

Conceptional Model : It is the Domain class and there relationship.

Storage Model :Database design model like table,views, stored procedure etc

Mapping :Mapping information about conceptional model mapped to storage model.

LinqToEntities : It a Language used to write query against object model.It returns entities defined in conceptional model

Entity Sql :It is Language used to write query the against data .

Object service: Convert the data from Entity Client Provider to Entity object stucture

EntityClient-Provider : Convert LinqtoEntity or LinqToSql queries to actual sql queries corresponds to database and connect to Ado.Net Provider, Which will send or receive the data from database.

Ado.Net Provider: Communicates with database , It is standarad ADO.NET

Multiple Model in EF;
1. Code First
2. Model First
3. Database First