共用方式為


ControllerBase.BadRequest 方法

定義

多載

BadRequest()

建立產生 Status400BadRequest 回應的 BadRequestResult

BadRequest(ModelStateDictionary)

建立產生 Status400BadRequest 回應的 BadRequestObjectResult

BadRequest(Object)

建立產生 Status400BadRequest 回應的 BadRequestObjectResult

BadRequest()

來源:
ControllerBase.cs
來源:
ControllerBase.cs
來源:
ControllerBase.cs

建立產生 Status400BadRequest 回應的 BadRequestResult

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

傳回

為回應建立的 BadRequestResult

屬性

適用於

BadRequest(ModelStateDictionary)

來源:
ControllerBase.cs
來源:
ControllerBase.cs
來源:
ControllerBase.cs

建立產生 Status400BadRequest 回應的 BadRequestObjectResult

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

參數

modelState
ModelStateDictionary

包含要傳回給用戶端之錯誤的 ModelStateDictionary

傳回

為回應建立的 BadRequestObjectResult

屬性

適用於

BadRequest(Object)

來源:
ControllerBase.cs
來源:
ControllerBase.cs
來源:
ControllerBase.cs

建立產生 Status400BadRequest 回應的 BadRequestObjectResult

public:
 virtual Microsoft::AspNetCore::Mvc::BadRequestObjectResult ^ BadRequest(System::Object ^ error);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.BadRequestObjectResult BadRequest (object error);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.BadRequestObjectResult BadRequest (object? error);
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member BadRequest : obj -> Microsoft.AspNetCore.Mvc.BadRequestObjectResult
override this.BadRequest : obj -> Microsoft.AspNetCore.Mvc.BadRequestObjectResult
Public Overridable Function BadRequest (error As Object) As BadRequestObjectResult

參數

error
Object

要傳回給客戶端的錯誤物件。

傳回

為回應建立的 BadRequestObjectResult

屬性

適用於