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)

Source:
StatusCodePagesExtensions.cs
Source:
StatusCodePagesExtensions.cs
Source:
StatusCodePagesExtensions.cs

添加具有默认响应处理程序的 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

参数

返回

适用于

UseStatusCodePages(IApplicationBuilder, StatusCodePagesOptions)

Source:
StatusCodePagesExtensions.cs
Source:
StatusCodePagesExtensions.cs
Source:
StatusCodePagesExtensions.cs

使用给定选项添加 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

参数

返回

适用于

UseStatusCodePages(IApplicationBuilder, Action<IApplicationBuilder>)

Source:
StatusCodePagesExtensions.cs
Source:
StatusCodePagesExtensions.cs
Source:
StatusCodePagesExtensions.cs

使用指定的备用中间件管道将 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>

返回

适用于

UseStatusCodePages(IApplicationBuilder, Func<StatusCodeContext,Task>)

Source:
StatusCodePagesExtensions.cs
Source:
StatusCodePagesExtensions.cs
Source:
StatusCodePagesExtensions.cs

添加具有指定处理程序的 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

参数

返回

适用于

UseStatusCodePages(IApplicationBuilder, String, String)

Source:
StatusCodePagesExtensions.cs
Source:
StatusCodePagesExtensions.cs
Source:
StatusCodePagesExtensions.cs

添加包含要发送的指定响应正文的 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

返回

适用于