You are on page 1of 2

What is Entity Framework?

Entity Framework (EF) is an object-relational mapper that enables .NET developers


to work with relational data using domain-specific objects. It eliminates the need for
most of the data-access code that developers usually need to write. In a lame
language we can say that it is a technology to write hassle free data access codes.
Entity framework can be used to access data from the existing as well as new
database.
There are two approaches for accessing data from the database.
1. Code First approach.: In this approach the model is designed in high-level
language(eg. POCO object) and the database is created on the fly when we
first run the application. We can also upgrade or downgrade the newly
created database using database migration technique.
2. Database first approach: In this approach the model is created depending
upon the database table. All the relationship and constraints are intact in the
model thus created.
The model in both the approach can be built by two methods:
1. By Code: we can code the model with help of high level language like c#. In
case of C# it is called POCO object.
2. By Entity-Framework designer: Entity framework designer provide boxes and
line to build model and establish relationship between them.
there are lots of convention in place to work efficiently with database using Entityframework.
For configuration we can have two ways:
1. Either by Convention

2. Or by using Fluent API.

Two
approache
s

Code First
Approach.
Database
First
Approach.

Model can
be built
using

POCO
object.
EF
designer.

Model can
be
configured
by
Table of content.
Overview of Entity Framework
a.
b.
c.
d.

What is entity framework.


Two approaches
Model building methods.
Ways to configure relationship, constraints and stuffs

Two Approaches
a. Code First Approach
i. New database
j. Existing database
b. Database first Approach
i. New database
j. Existing database

Conventio
n in place.
Configurat
ion
Method.

You might also like