DefaultProblemDetailsFactory.CreateValidationProblemDetails 方法

定义

创建一个 ValidationProblemDetails 实例,该实例根据 ApiBehaviorOptions中指定的值配置默认值。

public override Microsoft.AspNetCore.Mvc.ValidationProblemDetails CreateValidationProblemDetails (Microsoft.AspNetCore.Http.HttpContext httpContext, Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateDictionary modelStateDictionary, int? statusCode = default, string? title = default, string? type = default, string? detail = default, string? instance = default);
override this.CreateValidationProblemDetails : Microsoft.AspNetCore.Http.HttpContext * Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateDictionary * Nullable<int> * string * string * string * string -> Microsoft.AspNetCore.Mvc.ValidationProblemDetails
Public Overrides Function CreateValidationProblemDetails (httpContext As HttpContext, modelStateDictionary As ModelStateDictionary, 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 ValidationProblemDetails

参数

httpContext
HttpContext

HttpContext

modelStateDictionary
ModelStateDictionary

ModelStateDictionary

statusCode
Nullable<Int32>

Status的值。

title
String

Title的值。

type
String

Type的值。

detail
String

Detail的值。

instance
String

Instance的值。

返回

ValidationProblemDetails 实例。

适用于