MapWhenMiddleware Class

Respresents a middleware that runs a sub-request pipeline when a given predicate is matched.

Namespace
Microsoft.AspNetCore.Builder.Extensions
Assemblies
  • Microsoft.AspNetCore.Http.Abstractions

Syntax

public class MapWhenMiddleware
class Microsoft.AspNetCore.Builder.Extensions.MapWhenMiddleware

Constructors

MapWhenMiddleware(Microsoft.AspNetCore.Http.RequestDelegate, Microsoft.AspNetCore.Builder.Extensions.MapWhenOptions)

Creates a new instance of Microsoft.AspNetCore.Builder.Extensions.MapWhenMiddleware.

Arguments:
public MapWhenMiddleware(RequestDelegate next, MapWhenOptions options)

Methods

Invoke(Microsoft.AspNetCore.Http.HttpContext)

Executes the middleware.

Arguments:context (Microsoft.AspNetCore.Http.HttpContext) – The Microsoft.AspNetCore.Http.HttpContext for the current request.
Return type:System.Threading.Tasks.Task
Returns:A task that represents the execution of this middleware.
public Task Invoke(HttpContext context)