Jo Shields a575963da9 Imported Upstream version 3.6.0
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
2014-08-13 10:39:27 +01:00

35 lines
956 B
C#

namespace System.Web.Mvc {
public class HttpStatusCodeResult : ActionResult {
public HttpStatusCodeResult(int statusCode)
: this(statusCode, null) {
}
public HttpStatusCodeResult(int statusCode, string statusDescription) {
StatusCode = statusCode;
StatusDescription = statusDescription;
}
public int StatusCode {
get;
private set;
}
public string StatusDescription {
get;
private set;
}
public override void ExecuteResult(ControllerContext context) {
if (context == null) {
throw new ArgumentNullException("context");
}
context.HttpContext.Response.StatusCode = StatusCode;
if (StatusDescription != null) {
context.HttpContext.Response.StatusDescription = StatusDescription;
}
}
}
}