Udostępnij za pośrednictwem


MiddlewareWorkerApplicationBuilderExtensions.UseMiddleware Method

Definition

Overloads

UseMiddleware(IFunctionsWorkerApplicationBuilder, Func<FunctionContext,Func<Task>,Task>)

Configures the IFunctionsWorkerApplicationBuilder to use the provided inline middleware delegate.

UseMiddleware<T>(IFunctionsWorkerApplicationBuilder)

Configures the IFunctionsWorkerApplicationBuilder to use the provided middleware type.

UseMiddleware(IFunctionsWorkerApplicationBuilder, Func<FunctionContext,Func<Task>,Task>)

Source:
WorkerMiddlewareWorkerApplicationBuilderExtensions.cs

Configures the IFunctionsWorkerApplicationBuilder to use the provided inline middleware delegate.

public static Microsoft.Azure.Functions.Worker.IFunctionsWorkerApplicationBuilder UseMiddleware (this Microsoft.Azure.Functions.Worker.IFunctionsWorkerApplicationBuilder builder, Func<Microsoft.Azure.Functions.Worker.FunctionContext,Func<System.Threading.Tasks.Task>,System.Threading.Tasks.Task> middleware);
static member UseMiddleware : Microsoft.Azure.Functions.Worker.IFunctionsWorkerApplicationBuilder * Func<Microsoft.Azure.Functions.Worker.FunctionContext, Func<System.Threading.Tasks.Task>, System.Threading.Tasks.Task> -> Microsoft.Azure.Functions.Worker.IFunctionsWorkerApplicationBuilder
<Extension()>
Public Function UseMiddleware (builder As IFunctionsWorkerApplicationBuilder, middleware As Func(Of FunctionContext, Func(Of Task), Task)) As IFunctionsWorkerApplicationBuilder

Parameters

middleware
Func<FunctionContext,Func<Task>,Task>

The middleware to add to the invocation pipeline.

Returns

The same IFunctionsWorkerApplicationBuilder for chaining.

Applies to

UseMiddleware<T>(IFunctionsWorkerApplicationBuilder)

Source:
WorkerMiddlewareWorkerApplicationBuilderExtensions.cs

Configures the IFunctionsWorkerApplicationBuilder to use the provided middleware type.

public static Microsoft.Azure.Functions.Worker.IFunctionsWorkerApplicationBuilder UseMiddleware<T> (this Microsoft.Azure.Functions.Worker.IFunctionsWorkerApplicationBuilder builder) where T : class, Microsoft.Azure.Functions.Worker.Middleware.IFunctionsWorkerMiddleware;
static member UseMiddleware : Microsoft.Azure.Functions.Worker.IFunctionsWorkerApplicationBuilder -> Microsoft.Azure.Functions.Worker.IFunctionsWorkerApplicationBuilder (requires 'T : null and 'T :> Microsoft.Azure.Functions.Worker.Middleware.IFunctionsWorkerMiddleware)
<Extension()>
Public Function UseMiddleware(Of T As {Class, IFunctionsWorkerMiddleware}) (builder As IFunctionsWorkerApplicationBuilder) As IFunctionsWorkerApplicationBuilder

Type Parameters

T

Parameters

Returns

The same instance of the IFunctionsWorkerApplicationBuilder for chaining.

Applies to