In this article I would like to show you how to create a simple WEB API 2 using ASP.NET C#.
API is an Application Program Interface for either a web server or a web browser. ASP.NET Web API is a framework for building HTTP service for a wide range of devices. WEB API is very similar to ASP.NET MVC. It contains most of the MVC features like routing, controllers, action results, filter, model binders, etc. Let us create a simple application using the WEB API 2. Start Visual Studio and go to New Project, then click ASP.NET Web Application. After selecting the option give a name to the web application and click OK. Another dialog box will appear. In that dialog box select Empty web page and check the WEB API option. Now the Empty web application is created in the project. Then add a class like the the following image. Enter the following model code in the class file.
You can view the code from the GitHub link. Final Output
Read more articles on ASP.NET:
Programming C# 5.0