MiddlewareWorkerApplicationBuilderExtensions.UseMiddleware Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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>)
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
The IFunctionsWorkerApplicationBuilder to configure.
- 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)
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
The IFunctionsWorkerApplicationBuilder to configure.
Returns
The same instance of the IFunctionsWorkerApplicationBuilder for chaining.
Applies to
Azure SDK for .NET