Note – For this example, I am have used Visual Studio 2015 Update 1 for IDE and ASP.NET 5 RC1.
Recently I started working on an ASP.NET Web API application but I got stuck at one point for few hours. Let’s start from scratch and create the application first then we will see the behavior and various options. As I (most of us) like to start from clean slate so I created an empty ASP.NET application and followed the below stuff
- Added Microsoft.AspNet.Mvc as dependency in project.json.
- In ConfigureServices method of startup.cs, added services.AddMvc()
- In Configure method of startup.cs, added app.UseMvc();
- Added a Controllers folder in solution and added a controller class with name as PeopleController which inherits from Controller.
- Added the attribute route on the controller as
- Now we have done all the necessary set up and added a Controller for Web API. I have added a DataHelper
View original post 287 more words