UseExtensions.Use Yöntem

Tanım

Aşırı Yüklemeler

Use(IApplicationBuilder, Func<HttpContext,RequestDelegate,Task>)

Uygulamanın istek işlem hattına satır içinde tanımlanmış bir ara yazılım temsilcisi ekler. Sonraki işlevi çağırmıyorsanız, bunun yerine kullanın Run(IApplicationBuilder, RequestDelegate) .

Use(IApplicationBuilder, Func<HttpContext,Func<Task>,Task>)

Uygulamanın istek işlem hattına satır içinde tanımlanmış bir ara yazılım temsilcisi ekler. Sonraki işlevi çağırmıyorsanız, bunun yerine kullanın Run(IApplicationBuilder, RequestDelegate) .

Aşağıda gösterildiği gibi daha iyi performans için kullanmayı Use(IApplicationBuilder, Func<HttpContext,RequestDelegate,Task>) tercih edin:

app.Use((context, next) =>
{
    return next(context);
});

Use(IApplicationBuilder, Func<HttpContext,RequestDelegate,Task>)

Uygulamanın istek işlem hattına satır içinde tanımlanmış bir ara yazılım temsilcisi ekler. Sonraki işlevi çağırmıyorsanız, bunun yerine kullanın Run(IApplicationBuilder, RequestDelegate) .

public static Microsoft.AspNetCore.Builder.IApplicationBuilder Use (this Microsoft.AspNetCore.Builder.IApplicationBuilder app, Func<Microsoft.AspNetCore.Http.HttpContext,Microsoft.AspNetCore.Http.RequestDelegate,System.Threading.Tasks.Task> middleware);
static member Use : Microsoft.AspNetCore.Builder.IApplicationBuilder * Func<Microsoft.AspNetCore.Http.HttpContext, Microsoft.AspNetCore.Http.RequestDelegate, System.Threading.Tasks.Task> -> Microsoft.AspNetCore.Builder.IApplicationBuilder
<Extension()>
Public Function Use (app As IApplicationBuilder, middleware As Func(Of HttpContext, RequestDelegate, Task)) As IApplicationBuilder

Parametreler

middleware
Func<HttpContext,RequestDelegate,Task>

İsteği işleyen ve verilen sonraki işlevi çağıran bir işlev.

Döndürülenler

IApplicationBuilder örneği.

Şunlara uygulanır

Use(IApplicationBuilder, Func<HttpContext,Func<Task>,Task>)

Uygulamanın istek işlem hattına satır içinde tanımlanmış bir ara yazılım temsilcisi ekler. Sonraki işlevi çağırmıyorsanız, bunun yerine kullanın Run(IApplicationBuilder, RequestDelegate) .

Aşağıda gösterildiği gibi daha iyi performans için kullanmayı Use(IApplicationBuilder, Func<HttpContext,RequestDelegate,Task>) tercih edin:

app.Use((context, next) =>
{
    return next(context);
});
public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Builder::IApplicationBuilder ^ Use(Microsoft::AspNetCore::Builder::IApplicationBuilder ^ app, Func<Microsoft::AspNetCore::Http::HttpContext ^, Func<System::Threading::Tasks::Task ^> ^, System::Threading::Tasks::Task ^> ^ middleware);
public static Microsoft.AspNetCore.Builder.IApplicationBuilder Use (this Microsoft.AspNetCore.Builder.IApplicationBuilder app, Func<Microsoft.AspNetCore.Http.HttpContext,Func<System.Threading.Tasks.Task>,System.Threading.Tasks.Task> middleware);
static member Use : Microsoft.AspNetCore.Builder.IApplicationBuilder * Func<Microsoft.AspNetCore.Http.HttpContext, Func<System.Threading.Tasks.Task>, System.Threading.Tasks.Task> -> Microsoft.AspNetCore.Builder.IApplicationBuilder
<Extension()>
Public Function Use (app As IApplicationBuilder, middleware As Func(Of HttpContext, Func(Of Task), Task)) As IApplicationBuilder

Parametreler

middleware
Func<HttpContext,Func<Task>,Task>

İsteği işleyen ve verilen sonraki işlevi çağıran bir işlev.

Döndürülenler

IApplicationBuilder örneği.

Şunlara uygulanır