Compartir a través de


ControllerBase.BadRequest Método

Definición

Sobrecargas

BadRequest()

Crea un BadRequestResult que genera una respuesta Status400BadRequest.

BadRequest(ModelStateDictionary)

Crea un BadRequestObjectResult que genera una respuesta Status400BadRequest.

BadRequest(Object)

Crea un BadRequestObjectResult que genera una respuesta Status400BadRequest.

BadRequest()

Source:
ControllerBase.cs
Source:
ControllerBase.cs
Source:
ControllerBase.cs

Crea un BadRequestResult que genera una respuesta Status400BadRequest.

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

Devoluciones

El BadRequestResult creado para la respuesta.

Atributos

Se aplica a

BadRequest(ModelStateDictionary)

Source:
ControllerBase.cs
Source:
ControllerBase.cs
Source:
ControllerBase.cs

Crea un BadRequestObjectResult que genera una respuesta Status400BadRequest.

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

Parámetros

modelState
ModelStateDictionary

El ModelStateDictionary que contiene errores que se van a devolver al cliente.

Devoluciones

El BadRequestObjectResult creado para la respuesta.

Atributos

Se aplica a

BadRequest(Object)

Source:
ControllerBase.cs
Source:
ControllerBase.cs
Source:
ControllerBase.cs

Crea un BadRequestObjectResult que genera una respuesta Status400BadRequest.

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

Parámetros

error
Object

Objeto de error que se va a devolver al cliente.

Devoluciones

El BadRequestObjectResult creado para la respuesta.

Atributos

Se aplica a