1 instantiation of BadRequest
Microsoft.AspNetCore.Http.Results (1)
ResultsCache.cs (1)
12
public static BadRequest BadRequest { get; } =
new
();
18 references to BadRequest
Microsoft.AspNetCore.Http.Results (5)
BadRequest.cs (1)
19
/// Initializes a new instance of the <see cref="
BadRequest
"/> class with the values
BadRequestOfT.cs (1)
20
/// Initializes a new instance of the <see cref="
BadRequest
"/> class with the values
ResultsCache.cs (1)
12
public static
BadRequest
BadRequest { get; } = new();
TypedResults.cs (2)
674
/// <returns>The created <see cref="HttpResults.
BadRequest
"/> for the response.</returns>
675
public static
BadRequest
BadRequest() => ResultsCache.BadRequest;
Microsoft.AspNetCore.Http.Results.Tests (11)
BadRequestResultTests.cs (7)
22
var
badRequestResult = new BadRequest();
32
var
result = new BadRequest();
49
BadRequest
MyApi() { throw new NotImplementedException(); }
54
PopulateMetadata<
BadRequest
>(((Delegate)MyApi).GetMethodInfo(), builder);
66
var
result = new BadRequest();
77
Assert.Throws<ArgumentNullException>("method", () => PopulateMetadata<
BadRequest
>(null, new RouteEndpointBuilder(requestDelegate: null, RoutePatternFactory.Parse("/"), order: 0)));
78
Assert.Throws<ArgumentNullException>("builder", () => PopulateMetadata<
BadRequest
>(((Delegate)PopulateMetadata_ThrowsArgumentNullException_WhenMethodOrBuilderAreNull).GetMethodInfo(), null));
ResultsTests.cs (3)
254
var
result = Results.BadRequest() as
BadRequest
;
1736
(() => Results.BadRequest(null), typeof(
BadRequest
)),
TypedResultsTests.cs (1)
232
var
result = TypedResults.BadRequest();
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (1)
EndpointMetadataApiDescriptionProviderTest.cs (1)
280
var apiDescription = GetApiDescription(Results<Created<InferredJsonClass>,
BadRequest
> () =>
MinimalSample (1)
Program.cs (1)
72
app.MapGet("/todo/{id}", Results<Ok<Todo>, NotFound,
BadRequest
> (int id) => id switch