1 instantiation of BadRequest
Microsoft.AspNetCore.Http.Results (1)
TypedResults.cs (1)
683
public static BadRequest<TValue> BadRequest<TValue>(TValue? error) =>
new
(error);
18 references to BadRequest
Microsoft.AspNetCore.Http.Results (2)
TypedResults.cs (2)
682
/// <returns>The created <see cref="HttpResults.
BadRequest
{TValue}"/> for the response.</returns>
683
public static
BadRequest
<TValue> BadRequest<TValue>(TValue? error) => new(error);
Microsoft.AspNetCore.Http.Results.Tests (16)
BadRequestOfTResultTests.cs (10)
25
var
badRequestObjectResult = new BadRequest<object>(obj);
37
var
result = new BadRequest<HttpValidationProblemDetails>(obj);
49
var
result = new BadRequest<string>("Hello");
66
var
result = new BadRequest<string>("Hello");
89
var
result = new BadRequest<ProblemDetails>(details);
109
BadRequest
<Todo> MyApi() { throw new NotImplementedException(); }
114
PopulateMetadata<
BadRequest
<Todo>>(((Delegate)MyApi).GetMethodInfo(), builder);
127
var
result = new BadRequest<object>(null);
138
Assert.Throws<ArgumentNullException>("method", () => PopulateMetadata<
BadRequest
<object>>(null, new RouteEndpointBuilder(requestDelegate: null, RoutePatternFactory.Parse("/"), order: 0)));
139
Assert.Throws<ArgumentNullException>("builder", () => PopulateMetadata<
BadRequest
<object>>(((Delegate)PopulateMetadata_ThrowsArgumentNullException_WhenMethodOrBuilderAreNull).GetMethodInfo(), null));
ResultsTests.cs (5)
229
var
result = Results.BadRequest(value) as
BadRequest
<object>;
243
var
result = Results.BadRequest(value) as
BadRequest
<Todo>;
1737
(() => Results.BadRequest(new()), typeof(
BadRequest
<object>)),
TypedResultsTests.cs (1)
221
var
result = TypedResults.BadRequest(value);