delegate
A type that holds a reference to a method, so a method can be stored in a variable and called later.
In more detail
Func<T, bool> and Action<T> are built-in delegate types, and lambdas are converted to them. Middleware's next parameter is a delegate for the rest of the pipeline.
Related terms
- lambda expression — A short anonymous function written inline and passed to other code, such as a condition for a filter.
- 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.
- callback function — A function you hand to other code so that it can call it later, for example when a timer fires or an event happens.
Taught in
- The C# Language: Types, Variables, and Flow Control — Modern .NET Core, C# & Enterprise Microservices
- Collections, Generics, and LINQ — Modern .NET Core, C# & Enterprise Microservices
- The ASP.NET Core Middleware Pipeline — Modern .NET Core, C# & Enterprise Microservices