Bagikan melalui


MapWhenExtensions.MapWhen Metode

Definisi

Mencabangkan alur permintaan berdasarkan hasil predikat yang diberikan.

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

Parameter

predicate
Func<HttpContext,Boolean>

Dipanggil dengan lingkungan permintaan untuk menentukan apakah cabang harus diambil

configuration
Action<IApplicationBuilder>

Mengonfigurasi cabang yang akan diambil

Mengembalikan

Berlaku untuk