For creating Web API project open your Visual Studio Editor and Create New Project as shown in below figure.
Now you have to select ASP.Net Web Application(.NET Framework) from the list of installed templates as shown in the figure below and select Next Button.
Now Configure Your New Project window is open so here write down the Name of Project into the Text box Project Name after that change the location where you want to save your project and choose the targeted .Net Framework from the Framework dropdownlist then click on Create button.
Now it will show you some options like Empty,Web Forms,MVC,Web API inside the "create a new ASP.NET Application" template so choose Web API here and click on Create button as shown in the figure below.
Now you can see into the figure below we have successfully create a WEB API project now we have to analyse the folder structure of WEB API project. Here you can see three main folders Controllers,Views and Models with some other folders created automatically by the .NET Framework. Now expand the Controllers folder and open the file ValuesController which is default controller in WEB API and it inherites from the Base ApiController Class.
No comments:
Post a Comment