StatusCodePagesExtensions.UseStatusCodePages 方法

定义

重载

UseStatusCodePages(IApplicationBuilder)

添加一个 StatusCodePages 中间件,该中间件具有默认响应处理程序,该处理程序检查状态代码介于400和599之间的响应,但没有正文。

UseStatusCodePages(IApplicationBuilder, StatusCodePagesOptions)

添加一个 StatusCodePages 中间件,该中间件具有给定选项,这些选项用于检查状态代码介于400和599之间的响应,这些响应没有正文。

UseStatusCodePages(IApplicationBuilder, Action<IApplicationBuilder>)

使用指定的备用中间件管道将 StatusCodePages 中间件添加到管道,以生成响应正文。

UseStatusCodePages(IApplicationBuilder, Func<StatusCodeContext,Task>)

添加一个 StatusCodePages 中间件,该中间件具有指定的处理程序,用于检查状态代码介于400和599之间的响应,这些响应中没有正文。

UseStatusCodePages(IApplicationBuilder, String, String)

添加一个 StatusCodePages 中间件,其中包含要发送的指定响应正文。 这可能包括 {0} 状态代码的 "" 占位符。 中间件将检查状态代码介于400和599之间的响应,这些响应没有正文。

UseStatusCodePages(IApplicationBuilder)

添加一个 StatusCodePages 中间件,该中间件具有默认响应处理程序,该处理程序检查状态代码介于400和599之间的响应,但没有正文。

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Builder::IApplicationBuilder ^ UseStatusCodePages(Microsoft::AspNetCore::Builder::IApplicationBuilder ^ app);
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseStatusCodePages (this Microsoft.AspNetCore.Builder.IApplicationBuilder app);
static member UseStatusCodePages : Microsoft.AspNetCore.Builder.IApplicationBuilder -> Microsoft.AspNetCore.Builder.IApplicationBuilder
<Extension()>
Public Function UseStatusCodePages (app As IApplicationBuilder) As IApplicationBuilder

参数

返回

IApplicationBuilder

适用于

UseStatusCodePages(IApplicationBuilder, StatusCodePagesOptions)

添加一个 StatusCodePages 中间件,该中间件具有给定选项,这些选项用于检查状态代码介于400和599之间的响应,这些响应没有正文。

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Builder::IApplicationBuilder ^ UseStatusCodePages(Microsoft::AspNetCore::Builder::IApplicationBuilder ^ app, Microsoft::AspNetCore::Builder::StatusCodePagesOptions ^ options);
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseStatusCodePages (this Microsoft.AspNetCore.Builder.IApplicationBuilder app, Microsoft.AspNetCore.Builder.StatusCodePagesOptions options);
static member UseStatusCodePages : Microsoft.AspNetCore.Builder.IApplicationBuilder * Microsoft.AspNetCore.Builder.StatusCodePagesOptions -> Microsoft.AspNetCore.Builder.IApplicationBuilder
<Extension()>
Public Function UseStatusCodePages (app As IApplicationBuilder, options As StatusCodePagesOptions) As IApplicationBuilder

参数

返回

IApplicationBuilder

适用于

UseStatusCodePages(IApplicationBuilder, Action<IApplicationBuilder>)

使用指定的备用中间件管道将 StatusCodePages 中间件添加到管道,以生成响应正文。

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

参数

configuration
Action<IApplicationBuilder>

返回

IApplicationBuilder

适用于

UseStatusCodePages(IApplicationBuilder, Func<StatusCodeContext,Task>)

添加一个 StatusCodePages 中间件,该中间件具有指定的处理程序,用于检查状态代码介于400和599之间的响应,这些响应中没有正文。

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Builder::IApplicationBuilder ^ UseStatusCodePages(Microsoft::AspNetCore::Builder::IApplicationBuilder ^ app, Func<Microsoft::AspNetCore::Diagnostics::StatusCodeContext ^, System::Threading::Tasks::Task ^> ^ handler);
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseStatusCodePages (this Microsoft.AspNetCore.Builder.IApplicationBuilder app, Func<Microsoft.AspNetCore.Diagnostics.StatusCodeContext,System.Threading.Tasks.Task> handler);
static member UseStatusCodePages : Microsoft.AspNetCore.Builder.IApplicationBuilder * Func<Microsoft.AspNetCore.Diagnostics.StatusCodeContext, System.Threading.Tasks.Task> -> Microsoft.AspNetCore.Builder.IApplicationBuilder
<Extension()>
Public Function UseStatusCodePages (app As IApplicationBuilder, handler As Func(Of StatusCodeContext, Task)) As IApplicationBuilder

参数

返回

IApplicationBuilder

适用于

UseStatusCodePages(IApplicationBuilder, String, String)

添加一个 StatusCodePages 中间件,其中包含要发送的指定响应正文。 这可能包括 {0} 状态代码的 "" 占位符。 中间件将检查状态代码介于400和599之间的响应,这些响应没有正文。

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Builder::IApplicationBuilder ^ UseStatusCodePages(Microsoft::AspNetCore::Builder::IApplicationBuilder ^ app, System::String ^ contentType, System::String ^ bodyFormat);
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseStatusCodePages (this Microsoft.AspNetCore.Builder.IApplicationBuilder app, string contentType, string bodyFormat);
static member UseStatusCodePages : Microsoft.AspNetCore.Builder.IApplicationBuilder * string * string -> Microsoft.AspNetCore.Builder.IApplicationBuilder
<Extension()>
Public Function UseStatusCodePages (app As IApplicationBuilder, contentType As String, bodyFormat As String) As IApplicationBuilder

参数

contentType
String
bodyFormat
String

返回

IApplicationBuilder

适用于