Introduction
In this article we will do Create, Read, Update and Delete (CRUD) operations in the WebAPI using the Fiddler Tool. Here we need to create a database and connect with the Web API application. We can use the various methods for the CRUD operations in Fiddler, such as POST, GET, PUT and DELETE. The POST method is for creating the data, GET is used to read the data, PUT is used to update the data and finally is the DELETE method for deleting the data.
Now let's start by creating the database in SQL.
Step 1
Create a database :
- use mudita
- create table UserInfo(UId varchar(10) primary key, UserName varchar(20), Address varchar(50))
- Insert into UserInfo values('1','Smith','Delhi')
- Insert into UserInfo values('2','Jhon','Gurgao')
- Insert into UserInfo values('3','Priyam','Manipur')
Step 2
Now we will create a Web API application:
- Start Visual Studio 2013.
- From Start window Select "New Project".
- Select "Installed" -> "Template" -> "Visual C#" -> "Web" -> "Visual Studio 2012" and select "ASP.NET MVC4 Web Application".

- Click on the "OK" button.
- From the MVC4 project window select "Web API".

- Click on the "OK" button.
Step 2
Now add the ADO.NET Entity Model.
- Right-click on the Model folder in Solution Explorer.
- Select "Add" -> "New Item" -> "ADO.NET" and click on the "Add" button.

- Open a new Entity wizard.

- Click on the "Next" button then open the new dialog box.
- Click on the "New connection" button.
- And fill in the user id and password.

- Now select the option to create the sensitive data.
- Click on the "Next" button.
- Now select the table.

- Click on the "Finish" button.
- Then the Model diagram is displayed.

Step 3
Now in the Model folder add the Repository class with the following code:










Debendra DashPosted Jun 23, 2015, 6:32 AM
Good one.
Gowtham RajamanickamPosted Mar 27, 2015, 9:43 AM
goodone..
Nimit JoshiPosted Mar 27, 2014, 1:35 AM
Thanks Mudita.. This article is very easy to understand..
Raj KumarPosted Jan 17, 2014, 7:29 AM
well done mudita...nice article