You can find complete source code of this blog post at following location on Github-https://github.com/dotnetjalps/ASPNetCoreWebAPI

Recently Microsoft has released ASP.NET Core 1.0 RC2, I am getting lots of request from readers that about creating Web API. So I thought it will be a good idea to write a blog post about how to create Rest API(Web API) with ASP.NET Core 1.0.So let’s get started via creating an ASP.NET Core 1.0 Web Application like following.Once you click on ASP.NET Web Application, It will ask whether you need to create Web Application or Web API application. We are going to Web API so I am going to select Web API Application like following. Please note that in ASP.NET Core 1.0 there is no separate libraries or DLLs required for creating web APIs. This is just a project template.Now once you click on OK It will create a Web API application with default values controller and program.cs. As you know Program.cs is now starting point for the ASP.NET Core 1.0 application so It contains all the required configuration and startup items. Following is a code for that.Here you can see that there is a WebHostBuilder class which hosts the application and there is some configuration for using this application on IIS and Kestrel which is a cross-platform server from Microsoft.Now let’s create our model class first. I have created an Employee model class like following.Since now our model is ready, It’s time to create the controller. You can create web API controller via add new item like following.And here the code for our get Method.Here you can see that I have created a get method that returns a List of Employee. Now Let’s run this in our browser and it will work like following.That’s it. Hope you like it. Stay tuned for more!