8 types derived from StatusCodeResult
Microsoft.AspNetCore.Mvc.Core (8)
BadRequestResult.cs (1)
14public class BadRequestResult : StatusCodeResult
ConflictResult.cs (1)
13public class ConflictResult : StatusCodeResult
NoContentResult.cs (1)
13public class NoContentResult : StatusCodeResult
NotFoundResult.cs (1)
14public class NotFoundResult : StatusCodeResult
OkResult.cs (1)
14public class OkResult : StatusCodeResult
UnauthorizedResult.cs (1)
14public class UnauthorizedResult : StatusCodeResult
UnprocessableEntityResult.cs (1)
14public class UnprocessableEntityResult : StatusCodeResult
UnsupportedMediaTypeResult.cs (1)
14public class UnsupportedMediaTypeResult : StatusCodeResult
25 instantiations of StatusCodeResult
BasicWebSite (1)
Controllers\HomeController.cs (1)
61return new StatusCodeResult(StatusCodes.Status204NoContent);
FormatterWebSite (1)
Controllers\InputFormatterController.cs (1)
14return new StatusCodeResult(StatusCodes.Status400BadRequest);
Microsoft.AspNetCore.Mvc.Core (2)
ControllerBase.cs (1)
220=> new StatusCodeResult(statusCode);
RequireHttpsAttribute.cs (1)
68filterContext.Result = new StatusCodeResult(StatusCodes.Status403Forbidden);
Microsoft.AspNetCore.Mvc.Core.Test (7)
HttpStatusCodeResultTests.cs (2)
20var result = new StatusCodeResult(StatusCodes.Status404NotFound); 39var result = new StatusCodeResult(StatusCodes.Status404NotFound);
Infrastructure\ActionMethodExecutorTest.cs (2)
490public Task<IActionResult> ReturnIActionResultAsync() => Task.FromResult((IActionResult)new StatusCodeResult(201)); 494public Task<StatusCodeResult> ReturnsIActionResultSubTypeAsync() => Task.FromResult(new StatusCodeResult(200));
Infrastructure\ClientErrorResultFilterTest.cs (2)
76var actionResult = new StatusCodeResult(statusCode); 94var actionResult = new StatusCodeResult(statusCode);
RequireHttpsAttributeTests.cs (1)
223filterContext.Result = new StatusCodeResult(StatusCodes.Status404NotFound);
Microsoft.AspNetCore.Mvc.Cors (2)
CorsAuthorizationFilter.cs (1)
95context.Result = new StatusCodeResult(StatusCodes.Status204NoContent);
DisableCorsAuthorizationFilter.cs (1)
35context.Result = new StatusCodeResult(StatusCodes.Status204NoContent);
Microsoft.AspNetCore.Mvc.RazorPages (2)
PageBase.cs (1)
1147=> new StatusCodeResult(statusCode);
PageModel.cs (1)
1499=> new StatusCodeResult(statusCode);
Mvc.Api.Analyzers.Test (10)
TestFiles\ActualApiResponseMetadataFactoryTest\InspectReturnExpressionTests.cs (1)
27return new StatusCodeResult(204);
TestFiles\ActualApiResponseMetadataFactoryTest\InspectReturnExpressionTestsForSwitchExpression.cs (1)
38_ => new StatusCodeResult(204)
TestFiles\AddResponseTypeAttributeCodeFixProviderIntegrationTest\CodeFixAddsStatusCodesFromConstructorParameters.Input.cs (4)
18return new StatusCodeResult(422); 23return new StatusCodeResult(StatusCodes.Status202Accepted); 30return new StatusCodeResult(localStatusCode); 35return new StatusCodeResult(FieldStatusCode);
TestFiles\AddResponseTypeAttributeCodeFixProviderIntegrationTest\CodeFixAddsStatusCodesFromConstructorParameters.Output.cs (4)
24return new StatusCodeResult(422); 29return new StatusCodeResult(StatusCodes.Status202Accepted); 36return new StatusCodeResult(localStatusCode); 41return new StatusCodeResult(FieldStatusCode);
38 references to StatusCodeResult
BasicWebSite (2)
Controllers\TempDataPropertyController.cs (1)
45public StatusCodeResult CreateNoRedirect(Person person)
Filters\UnprocessableResultFilter.cs (1)
17if (context.Result is StatusCodeResult statusCodeResult &&
Microsoft.AspNetCore.Mvc.Core (12)
BadRequestResult.cs (1)
10/// A <see cref="StatusCodeResult"/> that when
ConflictResult.cs (1)
10/// A <see cref="StatusCodeResult"/> that when executed will produce a Conflict (409) response.
ControllerBase.cs (3)
214/// Creates a <see cref="StatusCodeResult"/> object by specifying a <paramref name="statusCode"/>. 217/// <returns>The created <see cref="StatusCodeResult"/> object for the response.</returns> 219public virtual StatusCodeResult StatusCode([ActionResultStatusCode] int statusCode)
NoContentResult.cs (1)
10/// A <see cref="StatusCodeResult"/> that when executed will produce a 204 No Content response.
NotFoundResult.cs (1)
10/// Represents an <see cref="StatusCodeResult"/> that when
OkResult.cs (1)
10/// An <see cref="StatusCodeResult"/> that when executed will produce an empty
StatusCodeResult.cs (2)
17/// Initializes a new instance of the <see cref="StatusCodeResult"/> class 40var logger = factory.CreateLogger(typeof(StatusCodeResult));
UnprocessableEntityResult.cs (1)
10/// A <see cref="StatusCodeResult"/> that when
UnsupportedMediaTypeResult.cs (1)
10/// A <see cref="StatusCodeResult"/> that when
Microsoft.AspNetCore.Mvc.Core.Test (12)
ControllerBaseTest.cs (2)
2327var result = statusCodeController.StatusCode_Int(statusCode); 3281public StatusCodeResult StatusCode_Int(int statusCode)
HttpStatusCodeResultTests.cs (2)
20var result = new StatusCodeResult(StatusCodes.Status404NotFound); 39var result = new StatusCodeResult(StatusCodes.Status404NotFound);
Infrastructure\ActionMethodExecutorTest.cs (2)
275Assert.IsType<StatusCodeResult>(await valueTask); 494public Task<StatusCodeResult> ReturnsIActionResultSubTypeAsync() => Task.FromResult(new StatusCodeResult(200));
Infrastructure\ClientErrorResultFilterTest.cs (2)
76var actionResult = new StatusCodeResult(statusCode); 94var actionResult = new StatusCodeResult(statusCode);
RequireHttpsAttributeTests.cs (4)
124var result = Assert.IsType<StatusCodeResult>(authContext.Result); 143var result = Assert.IsType<StatusCodeResult>(authContext.Result);
Microsoft.AspNetCore.Mvc.Cors.Test (2)
DisableCorsAuthorizationFilterTest.cs (2)
72var statusCodeResult = Assert.IsType<StatusCodeResult>(authorizationFilterContext.Result);
Microsoft.AspNetCore.Mvc.RazorPages (6)
PageBase.cs (3)
1142/// Creates a <see cref="StatusCodeResult"/> object by specifying a <paramref name="statusCode"/>. 1145/// <returns>The created <see cref="StatusCodeResult"/> object for the response.</returns> 1146public virtual StatusCodeResult StatusCode(int statusCode)
PageModel.cs (3)
1494/// Creates a <see cref="StatusCodeResult"/> object by specifying a <paramref name="statusCode"/>. 1497/// <returns>The created <see cref="StatusCodeResult"/> object for the response.</returns> 1498public virtual StatusCodeResult StatusCode(int statusCode)
Microsoft.AspNetCore.Mvc.RazorPages.Test (4)
PageModelTest.cs (2)
1712var result = statusCodeModel.StatusCode_Int(statusCode); 2070public StatusCodeResult StatusCode_Int(int statusCode)
PageTest.cs (2)
1702var result = statusCodePage.StatusCode_Int(statusCode); 1923public StatusCodeResult StatusCode_Int(int statusCode)