ApiController::BadRequest Method
Namespace:
System.Web.Http
Assembly: System.Web.Http (in System.Web.Http.dll)
| Name | Description | |
|---|---|---|
![]() | BadRequest() | Creates a BadRequestResult. |
![]() | BadRequest(ModelStateDictionary^) | Creates an InvalidModelStateResult with the specified model state. |
![]() | BadRequest(String^) | Creates an T:System.Web.Http.Results.ErrorMessageResult (400 Bad Request) with the specified error message. |
ApiController::BadRequest Method (ModelStateDictionary^)
Creates an InvalidModelStateResult with the specified model state.
public protected: virtual InvalidModelStateResult^ BadRequest( ModelStateDictionary^ modelState )
Parameters
- modelState
-
Type:
System.Web.Http.ModelBinding::ModelStateDictionary^
The model state to include in the error.
Return Value
Type: System.Web.Http.Results::InvalidModelStateResult^An InvalidModelStateResult with the specified model state.
ApiController::BadRequest Method (String^)
Creates an T:System.Web.Http.Results.ErrorMessageResult (400 Bad Request) with the specified error message.
Parameters
- message
-
Type:
System::String^
The user-visible error message.
Return Value
Type: System.Web.Http.Results::BadRequestErrorMessageResult^An InvalidModelStateResult with the specified model state.
Show:
