59 writes to Status
BasicWebSite (2)
Controllers\ContactApiController.cs (2)
108Status = 404, 123Status = 400,
Microsoft.AspNetCore.Diagnostics (3)
DeveloperExceptionPage\DeveloperExceptionPageMiddlewareImpl.cs (1)
257Status = httpContext.Response.StatusCode
ExceptionHandler\ExceptionHandlerMiddlewareImpl.cs (1)
195ProblemDetails = { Status = context.Response.StatusCode },
StatusCodePage\StatusCodePagesOptions.cs (1)
29!await problemDetailsService.TryWriteAsync(new() { HttpContext = context.HttpContext, ProblemDetails = { Status = statusCode } }))
Microsoft.AspNetCore.Http.Abstractions.Tests (4)
HttpValidationProblemDetailsJsonConverterTest.cs (1)
21problemDetails.Status = 404;
ProblemDetailsJsonConverterTest.cs (3)
166Status = 404, 197Status = 404, 221Status = 404,
Microsoft.AspNetCore.Http.Extensions (2)
src\Shared\ProblemDetails\ProblemDetailsDefaults.cs (2)
179problemDetails.Status = statusCode; 183problemDetails.Status = problemDetails is HttpValidationProblemDetails ?
Microsoft.AspNetCore.Http.Extensions.Tests (14)
ProblemDetailsDefaultWriterTest.cs (14)
34Status = StatusCodes.Status400BadRequest, 71Status = StatusCodes.Status400BadRequest, 103Status = StatusCodes.Status400BadRequest, 137Status = StatusCodes.Status400BadRequest, 179Status = StatusCodes.Status400BadRequest, 219Status = StatusCodes.Status400BadRequest, 256Status = StatusCodes.Status400BadRequest, 299Status = StatusCodes.Status400BadRequest, 342Status = StatusCodes.Status400BadRequest, 385Status = StatusCodes.Status400BadRequest, 428Status = StatusCodes.Status400BadRequest, 576context.ProblemDetails.Status = StatusCodes.Status406NotAcceptable; 590ProblemDetails = { Status = StatusCodes.Status400BadRequest } 622ProblemDetails = { Status = statusCode }
Microsoft.AspNetCore.Http.Results (4)
Results.cs (1)
807Status = statusCode,
src\Shared\ProblemDetails\ProblemDetailsDefaults.cs (2)
179problemDetails.Status = statusCode; 183problemDetails.Status = problemDetails is HttpValidationProblemDetails ?
TypedResults.cs (1)
792Status = statusCode,
Microsoft.AspNetCore.Http.Results.Tests (8)
BadRequestOfTResultTests.cs (1)
88var details = new ProblemDetails { Status = StatusCodes.Status422UnprocessableEntity, };
InternalServerErrorOfTResultTests.cs (1)
88var details = new ProblemDetails { Status = StatusCodes.Status422UnprocessableEntity, };
JsonResultTests.cs (2)
176Status = StatusCodes.Status418ImATeapot, 225var details = new ProblemDetails { Status = StatusCodes.Status413RequestEntityTooLarge, };
ProblemResultTests.cs (3)
111Status = StatusCodes.Status418ImATeapot, 173var details = new ProblemDetails { Status = StatusCodes.Status413RequestEntityTooLarge, }; 206var result = Assert.IsAssignableFrom<IStatusCodeHttpResult>(new ProblemHttpResult(new() { Status = StatusCodes.Status416RangeNotSatisfiable }));
ValidationProblemResultTests.cs (1)
90new HttpValidationProblemDetails { Status = StatusCodes.Status413RequestEntityTooLarge, }));
Microsoft.AspNetCore.Mvc.Core (10)
ControllerBase.cs (2)
1874Status = statusCode ?? 500, 1996Status = statusCode,
Formatters\TextOutputFormatter.cs (1)
138ProblemDetails = { Status = statusCode }
Infrastructure\DefaultProblemDetailsFactory.cs (3)
50Status = statusCode, 78Status = statusCode, 97problemDetails.Status ??= statusCode;
Infrastructure\ObjectResultExecutor.cs (1)
109ProblemDetails = { Status = statusCode }
ObjectResult.cs (1)
81details.Status = StatusCode;
src\Shared\ProblemDetails\ProblemDetailsDefaults.cs (2)
179problemDetails.Status = statusCode; 183problemDetails.Status = problemDetails is HttpValidationProblemDetails ?
Microsoft.AspNetCore.Mvc.Core.Test (8)
ActionResultOfTTest.cs (1)
81var value = new ProblemDetails { Status = StatusCodes.Status400BadRequest };
DependencyInjection\ApiBehaviorOptionsSetupTest.cs (1)
79Status = 422,
Infrastructure\DefaultApiProblemDetailsWriterTest.cs (2)
30Status = StatusCodes.Status400BadRequest, 67Status = StatusCodes.Status400BadRequest,
Infrastructure\ValidationProblemDetailsJsonConverterTest.cs (2)
142Status = 400 172Status = 400
ObjectResultTests.cs (2)
98var details = new ProblemDetails { Status = StatusCodes.Status413RequestEntityTooLarge, }; 129var details = new ProblemDetails { Status = StatusCodes.Status422UnprocessableEntity, };
Microsoft.AspNetCore.Mvc.Formatters.Xml (1)
ProblemDetailsWrapper.cs (1)
90ProblemDetails.Status = string.IsNullOrEmpty(value) ?
Microsoft.AspNetCore.Mvc.NewtonsoftJson (1)
AnnotatedProblemDetails.cs (1)
51problemDetails.Status = Status;
MinimalSample (2)
Program.cs (2)
86"object" => Results.Problem(new ProblemDetails() { Status = 500, Extensions = { { "traceId", "traceId123" } } }), 88"objectValidation" => Results.Problem(new HttpValidationProblemDetails(errors) { Status = 400, Extensions = { { "traceId", "traceId123" } } }),
135 references to Status
Diagnostics.FunctionalTests (5)
DeveloperExceptionPageSampleTest.cs (1)
51Assert.Equal(500, body.Status);
ProblemDetailsExceptionHandlerSampleTest.cs (2)
36Assert.Equal(500, body.Status); 53Assert.Equal(StatusCodes.Status409Conflict, body.Status);
StatusCodeSampleTest.cs (2)
91Assert.Equal(400, body.Status); 108Assert.Equal(400, body.Status);
Microsoft.AspNetCore.Http.Abstractions.Tests (11)
HttpValidationProblemDetailsJsonConverterTest.cs (4)
37Assert.Equal(problemDetails.Status, document.RootElement.GetProperty("status").GetInt32()); 68Assert.Equal(status, problemDetails.Status); 111Assert.Equal(status, problemDetails.Status); 150Assert.Equal(status, problemDetails.Status);
ProblemDetailsJsonConverterTest.cs (7)
52Assert.Equal(status, problemDetails.Status); 83Assert.Equal(status, problemDetails.Status); 115Assert.Equal(status, problemDetails.Status); 147Assert.Equal(status, problemDetails.Status); 175var expected = $"{{\"type\":\"{JsonEncodedText.Encode(value.Type)}\",\"title\":\"{value.Title}\",\"status\":{value.Status},\"detail\":\"{value.Detail}\",\"instance\":\"{JsonEncodedText.Encode(value.Instance)}\",\"traceId\":\"{traceId}\",\"some-data\":[\"value1\",\"value2\"]}}"; 199var expected = $"{{\"type\":\"{JsonEncodedText.Encode(value.Type)}\",\"title\":\"{value.Title}\",\"status\":{value.Status}}}"; 230var expected = $"{{\"type\":\"{JsonEncodedText.Encode(value.Type)}\",\"title\":\"{value.Title}\",\"status\":{value.Status},\"detail\":\"{value.Detail}\",\"instance\":\"{JsonEncodedText.Encode(value.Instance)}\",\"traceId\":null,\"some-data\":[\"value1\",\"value2\"]}}";
Microsoft.AspNetCore.Http.Extensions (2)
src\Shared\ProblemDetails\ProblemDetailsDefaults.cs (2)
175if (problemDetails.Status is null) 189var status = problemDetails.Status.GetValueOrDefault();
Microsoft.AspNetCore.Http.Extensions.Tests (21)
ProblemDetailsDefaultWriterTest.cs (21)
51Assert.Equal(expectedProblem.Status, problemDetails.Status); 156Assert.Equal(expectedProblem.Status, problemDetails.Status); 196Assert.Equal(expectedProblem.Status, problemDetails.Status); 236Assert.Equal(expectedProblem.Status, problemDetails.Status); 275Assert.Equal(expectedProblem.Status, problemDetails.Status); 318Assert.Equal(expectedProblem.Status, problemDetails.Status); 361Assert.Equal(expectedProblem.Status, problemDetails.Status); 404Assert.Equal(expectedProblem.Status, problemDetails.Status); 447Assert.Equal(expectedProblem.Status, problemDetails.Status); 561Assert.Equal(StatusCodes.Status500InternalServerError, problemDetails.Status); 597Assert.Equal(StatusCodes.Status406NotAcceptable, problemDetails.Status); 629Assert.Equal(statusCode, problemDetails.Status);
Microsoft.AspNetCore.Http.Results (10)
JsonHttpResultOfT.cs (2)
35statusCode ??= problemDetails.Status; 55statusCode ??= problemDetails.Status;
ProblemHttpResult.cs (1)
44public int StatusCode => ProblemDetails.Status!.Value;
Results.cs (2)
707/// <param name="statusCode">The value for <see cref="ProblemDetails.Status" />.</param> 726/// <param name="statusCode">The value for <see cref="ProblemDetails.Status" />.</param>
src\Shared\ProblemDetails\ProblemDetailsDefaults.cs (2)
175if (problemDetails.Status is null) 189var status = problemDetails.Status.GetValueOrDefault();
TypedResults.cs (2)
750/// <param name="statusCode">The value for <see cref="ProblemDetails.Status" />.</param> 771/// <param name="statusCode">The value for <see cref="ProblemDetails.Status" />.</param>
ValidationProblem.cs (1)
21if (problemDetails is { Status: not null and not StatusCodes.Status400BadRequest })
Microsoft.AspNetCore.Http.Results.Tests (29)
AcceptedAtRouteOfTResultTests.cs (1)
31Assert.Equal(StatusCodes.Status202Accepted, obj.Status);
AcceptedOfTResultTests.cs (1)
58Assert.Equal(StatusCodes.Status202Accepted, obj.Status);
BadRequestOfTResultTests.cs (2)
41Assert.Equal(StatusCodes.Status400BadRequest, obj.Status); 100Assert.Equal(StatusCodes.Status422UnprocessableEntity, details.Status.Value);
ConflictOfTResultTests.cs (1)
40Assert.Equal(StatusCodes.Status409Conflict, obj.Status);
CreatedAtRouteOfTResultTests.cs (1)
32Assert.Equal(StatusCodes.Status201Created, obj.Status);
CreatedOfTResultTests.cs (1)
28Assert.Equal(StatusCodes.Status201Created, obj.Status);
InternalServerErrorOfTResultTests.cs (2)
41Assert.Equal(StatusCodes.Status500InternalServerError, obj.Status); 100Assert.Equal(StatusCodes.Status422UnprocessableEntity, details.Status.Value);
JsonResultTests.cs (5)
138Assert.Equal(StatusCodes.Status500InternalServerError, responseDetails.Status); 167Assert.Equal(StatusCodes.Status400BadRequest, responseDetails.Status); 199Assert.Equal(StatusCodes.Status418ImATeapot, responseDetails.Status); 218Assert.Equal(StatusCodes.Status422UnprocessableEntity, details.Status.Value); 238Assert.Equal(StatusCodes.Status413RequestEntityTooLarge, details.Status.Value);
NotFoundOfTResultTests.cs (1)
26Assert.Equal(StatusCodes.Status404NotFound, obj.Status);
OkOfTResultTests.cs (1)
39Assert.Equal(StatusCodes.Status200OK, obj.Status);
ProblemResultTests.cs (6)
41Assert.Equal(StatusCodes.Status500InternalServerError, responseDetails.Status); 73Assert.Equal(StatusCodes.Status500InternalServerError, responseDetails.Status); 102Assert.Equal(StatusCodes.Status400BadRequest, responseDetails.Status); 134Assert.Equal(StatusCodes.Status418ImATeapot, responseDetails.Status); 164Assert.Equal(StatusCodes.Status400BadRequest, responseDetails.Status); 186Assert.Equal(StatusCodes.Status413RequestEntityTooLarge, details.Status.Value);
ResultsTests.cs (2)
1418Assert.Equal(statusCode, result.ProblemDetails.Status); 1449Assert.Equal(statusCode, result.ProblemDetails.Status);
TypedResultsTests.cs (2)
1205Assert.Equal(StatusCodes.Status400BadRequest, result.ProblemDetails.Status); 1231Assert.Equal(StatusCodes.Status400BadRequest, result.ProblemDetails.Status);
UnprocessableEntityOfTResultTests.cs (1)
27Assert.Equal(StatusCodes.Status422UnprocessableEntity, obj.Status);
ValidationProblemResultTests.cs (2)
45Assert.Equal(StatusCodes.Status400BadRequest, responseDetails.Status); 77Assert.Equal(StatusCodes.Status400BadRequest, responseDetails.Status);
Microsoft.AspNetCore.Mvc.Core (18)
ActionResultOfT.cs (2)
86if (Value is ProblemDetails problemDetails && problemDetails.Status != null) 88statusCode = problemDetails.Status.Value;
ControllerBase.cs (5)
1831/// <param name="statusCode">The value for <see cref="ProblemDetails.Status" />.</param> 1850/// <param name="statusCode">The value for <see cref="ProblemDetails.Status" />.</param> 1900StatusCode = problemDetails.Status 2021if (validationProblem is { Status: 400 }) 2029StatusCode = validationProblem?.Status
DependencyInjection\ApiBehaviorOptionsSetup.cs (2)
34if (problemDetails.Status == 400) 43StatusCode = problemDetails.Status,
Infrastructure\DefaultApiProblemDetailsWriter.cs (1)
58context.ProblemDetails.Status ?? context.HttpContext.Response.StatusCode,
Infrastructure\ProblemDetailsClientErrorFactory.cs (1)
21StatusCode = problemDetails.Status,
Infrastructure\ProblemDetailsFactory.cs (2)
18/// <param name="statusCode">The value for <see cref="ProblemDetails.Status"/>.</param> 37/// <param name="statusCode">The value for <see cref="ProblemDetails.Status"/>.</param>
ObjectResult.cs (3)
75if (details.Status != null && StatusCode == null) 77StatusCode = details.Status; 79else if (details.Status == null && StatusCode != null)
src\Shared\ProblemDetails\ProblemDetailsDefaults.cs (2)
175if (problemDetails.Status is null) 189var status = problemDetails.Status.GetValueOrDefault();
Microsoft.AspNetCore.Mvc.Core.Test (29)
ControllerBaseTest.cs (6)
2358Assert.Equal(400, problemDetails.Status); 2408Assert.Equal(405, problemDetails.Status); 2429Assert.Equal(400, problemDetails.Status); 2477Assert.Equal(500, problemDetails.Status); 2503Assert.Equal(500, problemDetails.Status); 2548Assert.Equal(422, problemDetails.Status);
DependencyInjection\ApiBehaviorOptionsSetupTest.cs (3)
45Assert.Equal(400, problemDetails.Status); 67Assert.Equal(400, problemDetails.Status); 91Assert.Equal(422, problemDetails.Status);
Infrastructure\DefaultApiProblemDetailsWriterTest.cs (4)
47Assert.Equal(expectedProblem.Status, problemDetails.Status); 86Assert.Equal(expectedProblem.Status, problemDetails.Status);
Infrastructure\ProblemDetailsFactoryTest.cs (6)
22Assert.Equal(500, problemDetails.Status); 43Assert.Equal(406, problemDetails.Status); 66Assert.Equal(406, problemDetails.Status); 89Assert.Equal(400, problemDetails.Status); 119Assert.Equal(422, problemDetails.Status); 151Assert.Equal(400, problemDetails.Status);
Infrastructure\ProblemDetalsClientErrorFactoryTest.cs (2)
33Assert.Equal(415, problemDetails.Status); 60Assert.Equal(415, problemDetails.Status);
Infrastructure\ValidationProblemDetailsJsonConverterTest.cs (5)
34Assert.Equal(status, problemDetails.Status); 76Assert.Equal(status, problemDetails.Status); 114Assert.Equal(status, problemDetails.Status); 154var expectedJSON = $"{{\"title\":\"{problemDetails.Title}\",\"status\":{problemDetails.Status}," + 187var expectedJSON = $"{{\"title\":\"{problemDetails.Title}\",\"status\":{problemDetails.Status}," +
ObjectResultTests.cs (3)
91Assert.Equal(StatusCodes.Status422UnprocessableEntity, details.Status.Value); 120Assert.Equal(StatusCodes.Status413RequestEntityTooLarge, details.Status.Value); 151Assert.Equal(StatusCodes.Status422UnprocessableEntity, details.Status.Value);
Microsoft.AspNetCore.Mvc.Formatters.Xml (2)
ProblemDetailsWrapper.cs (2)
131if (ProblemDetails.Status.HasValue) 134writer.WriteValue(ProblemDetails.Status.Value);
Microsoft.AspNetCore.Mvc.Formatters.Xml.Test (4)
ProblemDetailsWrapperTest.cs (1)
35Assert.Equal(403, problemDetails.Status);
ValidationProblemDetailsWrapperTest.cs (3)
39Assert.Equal(400, problemDetails.Status); 95Assert.Equal(400, problemDetails.Status); 132Assert.Equal(400, problemDetails.Status);
Microsoft.AspNetCore.Mvc.FunctionalTests (3)
ApiBehaviorTest.cs (3)
131Assert.Equal((int)HttpStatusCode.UnsupportedMediaType, problemDetails.Status); 306Assert.Equal(404, problemDetails.Status); 368Assert.Equal(400, validationProblemDetails.Status);
Microsoft.AspNetCore.Mvc.NewtonsoftJson (1)
AnnotatedProblemDetails.cs (1)
19Status = problemDetails.Status;