Class HttpStatusCodeResult
Provides a way to return an action result with a specific HTTP response status code and description.
public class HttpStatusCodeResult : ActionResult
- Inheritance
-
HttpStatusCodeResult
- Derived
- Inherited Members
Constructors
HttpStatusCodeResult(int)
Initializes a new instance of the HttpStatusCodeResult class using a status code.
public HttpStatusCodeResult(int statusCode)
Parameters
statusCode
intThe status code.
HttpStatusCodeResult(int, string)
Initializes a new instance of the HttpStatusCodeResult class using a status code and status description.
public HttpStatusCodeResult(int statusCode, string statusDescription)
Parameters
HttpStatusCodeResult(HttpStatusCode)
Initializes a new instance of the HttpStatusCodeResult class using a status code.
public HttpStatusCodeResult(HttpStatusCode statusCode)
Parameters
statusCode
HttpStatusCodeThe status code.
HttpStatusCodeResult(HttpStatusCode, string)
Initializes a new instance of the HttpStatusCodeResult class using a status code and status description.
public HttpStatusCodeResult(HttpStatusCode statusCode, string statusDescription)
Parameters
statusCode
HttpStatusCodeThe status code.
statusDescription
stringThe status description.
Properties
StatusCode
Gets the HTTP status code.
public int StatusCode { get; }
Property Value
- int
The HTTP status code.
StatusDescription
Gets the HTTP status description.
public string StatusDescription { get; }
Property Value
- string
the HTTP status description.
Methods
ExecuteResult(ControllerContext)
Enables processing of the result of an action method by a custom type that inherits from the ActionResult class.
public override void ExecuteResult(ControllerContext context)
Parameters
context
ControllerContextThe context in which the result is executed. The context information includes the controller, HTTP content, request context, and route data.