What is the ASP.NET Web API? The ASP.NET Web API is a framework that makes it easy to build HTTP services that reach a broad range of clients, including browsers and mobile devices. The ASP.NET Web API is an ideal platform for building REST applications on the .NET Framework.
Getting Started
First of all, you need to install the .Net framework 4.5 and MVC 4 if you are using Visual Studio 2010. Now create a new project in Visual Studio 2010 select ASP.NET MVC 4 Web Application and select Web API template and click OK.
Now add a new class in the Models "Employee".
Now add one more class "EmployeeRepository".
Now add one interface "IEmployeeRepository".
Now add a new controller "EmployeeController" and call all model functions to expose data.
![EmployeeController]()
Image 1
We are done here with models and controller work. Now you will see API data like this.
http://localhost:56065/api/employee.
Let's load the data into the view now.
Add a new view in the Views/Home folder.
Compile the application to see the result.
![Compile the application]()
Image 2
Enter the name, designation, and address to add a new record, and click Add New.
![Add New]()
Image 3
To update an existing record, enter the record type ID click Get edit the data, and click Update.
![Record type ID]()
Image 4