Partilhar via


MiddlewareWorkerApplicationBuilderExtensions.UseWhen Método

Definição

Sobrecargas

UseWhen(IFunctionsWorkerApplicationBuilder, Func<FunctionContext,Boolean>, Func<FunctionContext,Func<Task>,Task>)

Configura o IFunctionsWorkerApplicationBuilder para usar o delegado de middleware embutido fornecido quando a expressão de predicado fornecida retorna true.

UseWhen<T>(IFunctionsWorkerApplicationBuilder, Func<FunctionContext,Boolean>)

Configura o IFunctionsWorkerApplicationBuilder para usar o tipo de middleware fornecido, quando a expressão de predicado fornecida retorna true.

UseWhen(IFunctionsWorkerApplicationBuilder, Func<FunctionContext,Boolean>, Func<FunctionContext,Func<Task>,Task>)

Origem:
WorkerMiddlewareWorkerApplicationBuilderExtensions.cs

Configura o IFunctionsWorkerApplicationBuilder para usar o delegado de middleware embutido fornecido quando a expressão de predicado fornecida retorna true.

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

Parâmetros

predicate
Func<FunctionContext,Boolean>

Predicado que é invocado para determinar se o middleware deve ser executado durante uma invocação de função.

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

O middleware a ser adicionado ao pipeline de invocação.

Retornos

O mesmo IFunctionsWorkerApplicationBuilder para encadeamento.

Aplica-se a

UseWhen<T>(IFunctionsWorkerApplicationBuilder, Func<FunctionContext,Boolean>)

Origem:
WorkerMiddlewareWorkerApplicationBuilderExtensions.cs

Configura o IFunctionsWorkerApplicationBuilder para usar o tipo de middleware fornecido, quando a expressão de predicado fornecida retorna true.

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

Parâmetros de tipo

T

Parâmetros

predicate
Func<FunctionContext,Boolean>

Predicado que é invocado para determinar se o middleware deve ser executado durante uma invocação de função.

Retornos

A mesma instância do IFunctionsWorkerApplicationBuilder para encadeamento.

Aplica-se a