What is Entity Framework..?

Assalamualaykum wr br..:
Today we discuss what EF is..?
EF is ORM framework. ORM -> Object Relational Mapping. ORM automatically creates classes based on Database tables, and vice versa is also true. ie. it can also automatically generate SQL to create database tables based on classes.
Lets start a small project on it to understand better. To achieve it,
1. Create Department and Employee Classes.
2. Write ADO.Net code to retrieve data from the database.
3. Need to create objects of Department and classes to populate data.
Entity Framework can do all the above statements automatically , if we provide it with database shema.
Create the Database and tables as shown below:
Now add the Ado.net Entity Data Model and name it as EmployeeModel.edmx file and this results in wizard, supply the necessary values and finish.
compile the solution and add new webform in which add gridveiw and entity datasource control and then configure the Entity datasource with database and tables of employee and department and allow it to generate from database.
Thats it for the day..also  please have a look on the versions of EF.
The following table lists all the important versions of Entity Framework.

EF Version Introduced Features
EF 3.5 Basic O/RM support with Database First approach.
EF 4.0 POCO Support, Lazy loading, testability improvements, customizable code generation and the Model First approach.
EF 4.1 First to available in the NuGet, Simplified DBContext API over ObjectContext, Code First approach. EF 4.1.1 patch released with bug fixing of 4.1.
EF 4.3 Code First Migrations feature that allows a database created by Code First to be incrementally changed as your Code First model evolves. EF 4.3.1 patch released with bug fixing of EF 4.3.
EF 5.0 Announced EF as Open Source. Introduced Enum support, table-valued functions, spatial data types, multiple-diagrams per model, coloring of shapes on the design surface and batch import of stored procedures, EF Power Tools and various performance improvements.
EF 6.0 – Current release EF 6.0/6.1 is the latest release of Entity Framework. It includes many new features related to Code First & EF designer like asynchronous query & save, connection Resiliency, dependency resolution etc.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s