public static WebStatus Error(string message, HttpStatusCode httpStatusCode = HttpStatusCode.InternalServerError) { var status = new WebStatus(); status.AddError(message, httpStatusCode); return(status); }
} // only used with HttpStatusCode.Redirect public void Add(WebStatus status) { Messages = Messages.Concat(status.Messages).ToList(); if (status.StatusCode != HttpStatusCode.OK) { StatusCode = status.StatusCode; } }
public static WebStatus Redirect(string redirectUrl, string message = null) { var status = new WebStatus() { StatusCode = HttpStatusCode.Redirect, RedirectUrl = redirectUrl, }; if (message != null) { status.AddSuccess(message); } return(status); }