next delegate
The delegate a middleware calls to pass the request to the rest of the pipeline, and whose completion signals the response is on its way back.
In more detail
Every middleware added with app.Use receives one. Work before await next() happens on the way in, work after it on the way out; not calling it short-circuits the request.
Related terms
- middleware — Code that sits between an incoming request and the handler that answers it, doing a shared job such as logging, authentication or rate limiting.
- short-circuiting — A middleware ending a request by writing the response itself instead of calling the next component.
- delegate — A type that holds a reference to a method, so a method can be stored in a variable and called later.
Taught in
- The ASP.NET Core Middleware Pipeline — Modern .NET Core, C# & Enterprise Microservices