IApplicationBuilder.Use(Func<RequestDelegate,RequestDelegate>) Method

Definition

Adds a middleware delegate to the application's request pipeline.

C#
public Microsoft.AspNetCore.Builder.IApplicationBuilder Use (Func<Microsoft.AspNetCore.Http.RequestDelegate,Microsoft.AspNetCore.Http.RequestDelegate> middleware);

Parameters

middleware
Func<RequestDelegate,RequestDelegate>

The middleware delegate.

Returns

The IApplicationBuilder.

Applies to

Product Versions
ASP.NET Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0