StatusCodeResult Class

Represents an Microsoft.AspNetCore.Mvc.ActionResult that when executed will produce an HTTP response with the given response status code.

Namespace
Microsoft.AspNetCore.Mvc
Assemblies
  • Microsoft.AspNetCore.Mvc.Core

Syntax

public class StatusCodeResult : ActionResult, IActionResult
class Microsoft.AspNetCore.Mvc.StatusCodeResult

Constructors

StatusCodeResult(System.Int32)

Initializes a new instance of the Microsoft.AspNetCore.Mvc.StatusCodeResult class with the given <em>statusCode</em>.

Arguments:statusCode (System.Int32) – The HTTP status code of the response.
public StatusCodeResult(int statusCode)

Methods

ExecuteResult(Microsoft.AspNetCore.Mvc.ActionContext)
public override void ExecuteResult(ActionContext context)

Properties

Microsoft.AspNetCore.Mvc.StatusCodeResult.StatusCode

Gets the HTTP status code.

Return type:System.Int32
public int StatusCode { get; }