Category Archives: Entity Framework

Code First Demo

Open Visual Studio. Create a new Console Application project and named it to CodeFirstDemo Install Entity Framework by using NuGet Package Manager Console PM> Install-Package EntityFramework With code first we start with the code. So we will not going to Management Studio and create a new database. Instead we will create a new class called… Read More »

Database First Demo

We will create a simple database table. Then we will use entity framework to generate a domain class based on that table. The whole process is given below- Open Microsoft SQL Server Management Studio. From Object Explorer Right Mouse click on Database folder -> New Database as shown below- Give the Database Name -> Select… Read More »

Workflows of Entity Framework

There are three workflows to build a domain model using Entity Framework. They are Database First Code First Model First 1. Database First In this case we start with the database. Here- At first we design our tables Then Entity Framework generates domain classes based on the database This is the traditional approach that a… Read More »

What is Entity Framework

If we need to access a database from our application we need a persistence framework. With the persistence framework we will be able to load our objects from database or save them to database. We can write the persistence framework by ourselves using plain ADO.NET classes’ like- SqlConnection SqlCommand SqlDataReader Or we can also use… Read More »