In order to create an MVC Web API, you must need Visual Studio, ASP.Net framework 4.0 or above and MVC 4 template installed.
Steps to create basic MVC Web API:
- Open Visual Studio, select File > New > Project > Visual C# > Web > ASP.NET MVC 4 Web Application > Name: Your MVC Project Name and click OK.
- Select Web API project template from the list and click OK.
- Visual Studio will now create basic MVC Web API project. Here I have created a folder name Presentation to organize my code.
- You can now additional models, views and controllers based on your requirements. But for now I would like to add a class library under another folder Integration.
- Finally I will add Integration.Facebook Class Library and rename the Class1.cs to Helper.cs
- You can now add your logic in Helper.cs class. I will add sample code in my next post “Integration of Facebook”.