This tutorial will show you how you can perform insert, update, delete operation in an mvc application using entity framework. This is called CRUD functionality. This you can use in MVC3, MVC4, MVC5.
Here we use entity framework 6 with MVC5.
First of here is our sql table:
Here we use entity framework 6 with MVC5.
First of here is our sql table:

So for this tutorial first we will create a new empty mvc application in this we will add a ADO.NET entity data model in Model.

Select EF Designer from database.

Then select Server name and Database name.

Select Yes radio button and click on Next.

Select Entity Framework 6.x.

Then Select table.

Now MVCdb.edmx add in Model folder.

Now Add Employee Controller.

Choose MVC5 Controller with views, using Entity Framework.

Select Model class and DataContextClass and give Controller name Employee.

so now, automatically create Index,Create,Delete,Edit,Details Views and Controller actions.

Now Run Application. (ctrl+F5)

Clcik on Create New.

Add data and Click on Create button.

1 comments:
good.
ReplyPost a Comment