ControllerBase.ValidationProblem 方法

定義

多載

ValidationProblem(ModelStateDictionary)

建立 ActionResult ,它會產生 Status400BadRequest 來自的驗證錯誤的回應 modelStateDictionary

ValidationProblem(ValidationProblemDetails)

建立 BadRequestObjectResult 產生 Status400BadRequest 回應的。

ValidationProblem()

建立 ActionResult ,它會產生 Status400BadRequest 來自的驗證錯誤的回應 ModelState

ValidationProblem(String, String, Nullable<Int32>, String, String, ModelStateDictionary)

建立 ActionResult ,它會產生 Status400BadRequest 具有值的回應 ValidationProblemDetails

ValidationProblem(ModelStateDictionary)

建立 ActionResult ,它會產生 Status400BadRequest 來自的驗證錯誤的回應 modelStateDictionary

public:
 virtual Microsoft::AspNetCore::Mvc::ActionResult ^ ValidationProblem(Microsoft::AspNetCore::Mvc::ModelBinding::ModelStateDictionary ^ modelStateDictionary);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.ActionResult ValidationProblem (Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateDictionary modelStateDictionary);
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member ValidationProblem : Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateDictionary -> Microsoft.AspNetCore.Mvc.ActionResult
override this.ValidationProblem : Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateDictionary -> Microsoft.AspNetCore.Mvc.ActionResult
Public Overridable Function ValidationProblem (modelStateDictionary As ModelStateDictionary) As ActionResult

參數

modelStateDictionary
ModelStateDictionary

ModelStateDictionary

傳回

ActionResult

針對回應所建立的 BadRequestObjectResult

屬性

適用於

ValidationProblem(ValidationProblemDetails)

建立 BadRequestObjectResult 產生 Status400BadRequest 回應的。

public:
 virtual Microsoft::AspNetCore::Mvc::ActionResult ^ ValidationProblem(Microsoft::AspNetCore::Mvc::ValidationProblemDetails ^ descriptor);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.ActionResult ValidationProblem (Microsoft.AspNetCore.Mvc.ValidationProblemDetails descriptor);
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member ValidationProblem : Microsoft.AspNetCore.Mvc.ValidationProblemDetails -> Microsoft.AspNetCore.Mvc.ActionResult
override this.ValidationProblem : Microsoft.AspNetCore.Mvc.ValidationProblemDetails -> Microsoft.AspNetCore.Mvc.ActionResult
Public Overridable Function ValidationProblem (descriptor As ValidationProblemDetails) As ActionResult

參數

傳回

ActionResult

針對回應所建立的 BadRequestObjectResult

屬性

適用於

ValidationProblem()

建立 ActionResult ,它會產生 Status400BadRequest 來自的驗證錯誤的回應 ModelState

public:
 virtual Microsoft::AspNetCore::Mvc::ActionResult ^ ValidationProblem();
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.ActionResult ValidationProblem ();
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member ValidationProblem : unit -> Microsoft.AspNetCore.Mvc.ActionResult
override this.ValidationProblem : unit -> Microsoft.AspNetCore.Mvc.ActionResult
Public Overridable Function ValidationProblem () As ActionResult

傳回

ActionResult

針對回應所建立的 ActionResult

屬性

適用於

ValidationProblem(String, String, Nullable<Int32>, String, String, ModelStateDictionary)

建立 ActionResult ,它會產生 Status400BadRequest 具有值的回應 ValidationProblemDetails

[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.ActionResult ValidationProblem (string detail = default, string instance = default, int? statusCode = default, string title = default, string type = default, Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateDictionary modelStateDictionary = default);
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member ValidationProblem : string * string * Nullable<int> * string * string * Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateDictionary -> Microsoft.AspNetCore.Mvc.ActionResult
override this.ValidationProblem : string * string * Nullable<int> * string * string * Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateDictionary -> Microsoft.AspNetCore.Mvc.ActionResult
Public Overridable Function ValidationProblem (Optional detail As String = Nothing, Optional instance As String = Nothing, Optional statusCode As Nullable(Of Integer) = Nothing, Optional title As String = Nothing, Optional type As String = Nothing, Optional modelStateDictionary As ModelStateDictionary = Nothing) As ActionResult

參數

detail
String

的值 Detail

instance
String

的值 Instance

statusCode
Nullable<Int32>

狀態碼。

title
String

的值 Title

type
String

的值 Type

modelStateDictionary
ModelStateDictionary

ModelStateDictionarynull使用時 ModelState

傳回

ActionResult

針對回應所建立的 ActionResult

屬性

適用於