Compartilhar via


UseWhenExtensions.UseWhen Método

Definição

Cria condicionalmente um branch no pipeline de solicitação que é reingressado no pipeline de main.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Builder::IApplicationBuilder ^ UseWhen(Microsoft::AspNetCore::Builder::IApplicationBuilder ^ app, Func<Microsoft::AspNetCore::Http::HttpContext ^, bool> ^ predicate, Action<Microsoft::AspNetCore::Builder::IApplicationBuilder ^> ^ configuration);
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseWhen (this Microsoft.AspNetCore.Builder.IApplicationBuilder app, Func<Microsoft.AspNetCore.Http.HttpContext,bool> predicate, Action<Microsoft.AspNetCore.Builder.IApplicationBuilder> configuration);
static member UseWhen : Microsoft.AspNetCore.Builder.IApplicationBuilder * Func<Microsoft.AspNetCore.Http.HttpContext, bool> * Action<Microsoft.AspNetCore.Builder.IApplicationBuilder> -> Microsoft.AspNetCore.Builder.IApplicationBuilder
<Extension()>
Public Function UseWhen (app As IApplicationBuilder, predicate As Func(Of HttpContext, Boolean), configuration As Action(Of IApplicationBuilder)) As IApplicationBuilder

Parâmetros

predicate
Func<HttpContext,Boolean>

Invocado com o ambiente de solicitação para determinar se a ramificação deve ser adotada

configuration
Action<IApplicationBuilder>

Configura uma ramificação a ser adotada

Retornos

Aplica-se a