Entity Framework

What is Entity Framework

In asp.net to interact with database we use Ado.net. Entity framework allows you to also work with database.

As LINQ to SQL support only SQL Server database, Entity framework support almost all database like oracle, MySQL etc.


DataBase Approach

Introduction of Database Approach

In Database First Approach first we create database and then we will create designer and code file using this database.


Edmx file in Entity Framework

.edmx is basically an XML file which is generated when we added Entity Framework model. It is Entity Data Model Xml which contains designer (Model) and code file(.cs).


Insert data using Entity Framework

In my last article we discussed about the edmx file. I hope now you are little bit familier with entity framework and we can start the basic functionality like insert, update, delete and select.


Select data using Entity Framework

In my last article I discussed how to insert data in database using Entity Framework. I am taking the same example and file for this article. In this article I will show how we can select data from database using Entity Framework.


Code First Approach

What is Code First Approach

In code first approach first we create classes (Code) and using this code database will be get generated. We need not use edmx file in code first approach. In code first approach code-first api is responsible to create and update database.


Code First Relationship Implementation

In my last article we have discussed how to create entity framework and we also create one to one relationship also as every employee is having one department. In this example I want to show many to many relationship.


Model Changes in Code First

In our previous example we work on code first approach with relationships. In this article I want to explain the changes of model in code first approach. After creating database using code-first-api if we need to change like addition of new column, data type of previous column etc.


You can suggest topics which you want to add in this tutorial. Our team will try to add them. Thanks