ApiController.BadRequest ApiController.BadRequest ApiController.BadRequest Method

Definition

Overloads

BadRequest() BadRequest() BadRequest()

Creates a BadRequestResult (400 Bad Request).

BadRequest(ModelStateDictionary) BadRequest(ModelStateDictionary) BadRequest(ModelStateDictionary)

Creates an InvalidModelStateResult (400 Bad Request) with the specified model state.

BadRequest(String) BadRequest(String) BadRequest(String)

Creates a BadRequestErrorMessageResult (400 Bad Request) with the specified error message.

BadRequest() BadRequest() BadRequest()

Creates a BadRequestResult (400 Bad Request).

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

Returns

BadRequest(ModelStateDictionary) BadRequest(ModelStateDictionary) BadRequest(ModelStateDictionary)

Creates an InvalidModelStateResult (400 Bad Request) with the specified model state.

[Microsoft.AspNetCore.Mvc.NonAction]
public virtual System.Web.Http.InvalidModelStateResult BadRequest (Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateDictionary modelState);
abstract member BadRequest : Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateDictionary -> System.Web.Http.InvalidModelStateResult
override this.BadRequest : Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateDictionary -> System.Web.Http.InvalidModelStateResult
Public Overridable Function BadRequest (modelState As ModelStateDictionary) As InvalidModelStateResult

Parameters

modelState
ModelStateDictionary ModelStateDictionary ModelStateDictionary

The model state to include in the error.

Returns

BadRequest(String) BadRequest(String) BadRequest(String)

Creates a BadRequestErrorMessageResult (400 Bad Request) with the specified error message.

[Microsoft.AspNetCore.Mvc.NonAction]
public virtual System.Web.Http.BadRequestErrorMessageResult BadRequest (string message);
abstract member BadRequest : string -> System.Web.Http.BadRequestErrorMessageResult
override this.BadRequest : string -> System.Web.Http.BadRequestErrorMessageResult
Public Overridable Function BadRequest (message As String) As BadRequestErrorMessageResult

Parameters

message
String String String

The user-visible error message.

Returns

Applies to