Share via


TypedResults.BadRequest Method

Definition

Overloads

BadRequest()

Produces a Status400BadRequest response.

BadRequest<TValue>(TValue)

Produces a Status400BadRequest response.

BadRequest()

Source:
TypedResults.cs

Produces a Status400BadRequest response.

public static Microsoft.AspNetCore.Http.HttpResults.BadRequest BadRequest ();
static member BadRequest : unit -> Microsoft.AspNetCore.Http.HttpResults.BadRequest
Public Shared Function BadRequest () As BadRequest

Returns

The created BadRequest for the response.

Applies to

BadRequest<TValue>(TValue)

Source:
TypedResults.cs

Produces a Status400BadRequest response.

public static Microsoft.AspNetCore.Http.HttpResults.BadRequest<TValue> BadRequest<TValue> (TValue? error);
static member BadRequest : 'Value -> Microsoft.AspNetCore.Http.HttpResults.BadRequest<'Value>
Public Shared Function BadRequest(Of TValue) (error As TValue) As BadRequest(Of TValue)

Type Parameters

TValue

The type of error object that will be JSON serialized to the response body.

Parameters

error
TValue

The value to be included in the HTTP response body.

Returns

The created BadRequest<TValue> for the response.

Applies to