共用方式為


DefaultProblemDetailsFactory.CreateProblemDetails 方法

定義

建立 ProblemDetails 實例,根據 ApiBehaviorOptions中指定的值來設定預設值。

public override Microsoft.AspNetCore.Mvc.ProblemDetails CreateProblemDetails (Microsoft.AspNetCore.Http.HttpContext httpContext, int? statusCode = default, string? title = default, string? type = default, string? detail = default, string? instance = default);
override this.CreateProblemDetails : Microsoft.AspNetCore.Http.HttpContext * Nullable<int> * string * string * string * string -> Microsoft.AspNetCore.Mvc.ProblemDetails
Public Overrides Function CreateProblemDetails (httpContext As HttpContext, Optional statusCode As Nullable(Of Integer) = Nothing, Optional title As String = Nothing, Optional type As String = Nothing, Optional detail As String = Nothing, Optional instance As String = Nothing) As ProblemDetails

參數

httpContext
HttpContext

HttpContext

statusCode
Nullable<Int32>

Status的值。

title
String

Title的值。

type
String

Type的值。

detail
String

Detail的值。

instance
String

Instance的值。

傳回

ProblemDetails 實例。

適用於