ASP.NET Core Middleware is software integrated inside the application's pipeline that we can use to handle requests and responses. When we talk about the ASP.NET Core middleware, we can think of it as a code section that executes with every request. In this article, we are going to learn more about the ASP.NET Core middleware and how to use different methods (Run, Map, Use) during the configuration. Additionally, we are going to explain the process of creating custom middleware.
We are going to divide this article into the following sections:
- More About the ASP.NET Core Middleware and Pipeline
- Middleware Order in ASP.NET Core
- Creating a First Middleware Component in ASP.NET Core
- Using the Map and MapWhen Methods for Branching
- Creating a Middleware in a Separate Class