In this article, we are going to understand the new pipeline concept in ASP.NET Core, Middleware. If you have been doing ASP.NET stuff for a while, you must have known that HTTP-Handlers and HTTP-Modules have always been part of the ASP.NET processing structure. But, with the new ASP.NET Core concept, Handlers and Modules are now history. They are no longer in use. Instead, the new Pipeline is implemented and that is called
Middleware. Developers can utilize normal existing Middlewares or they can write their own custom Middleware depending on the need. Below is the high level diagram of MiddleWare.
Here, once an HTTP request comes at the ASP.NET server, the server will delegate the request to the first middleware in our application. Each middleware has the option of creating a response, or calling the next middleware. Basically, it's a bi-directional pipeline. Therefore, if the first component passes the request to the next middleware, the first component will see a response coming out of the other components. Each Middleware has got specific sets of functionalities. Now, let’s see how to configure Middleware. Let me create one empty project as shown below. Here, I am using Visual Studio 2017 RC Version. You can use VS-2015 as well.