Before creating the controller, we need to remove the following app.Run statement as this will return Hello World! for all the incoming requests. As we want incoming requests to be handled by the controllers, we need to remove the following code from the Configure method of the Startup class:
app.Run(async (context) =>
{
await context.Response.WriteAsync("Hello World!");
};
We have installed ASP.NET Core in our application. So, we are geared up for creating our first ASP.NET Core controller. Create a folder with the name Controllers and add a new controller from the context menu, as shown in the following screenshot:
Context basically represents the request-response pair along with other metadata necessary to process the request.
For people who used OWIN to develop your own web custom framework without using MVC, it is analogous...