Esempio n. 1
0
 public ErrorHandler(RequestDelegate next, int status, IErrorPage page, WebServiceType check)
 {
     _next = next;
     _page = page;
     _status = status;
     _check = check;
 }
Esempio n. 2
0
 public PartialViewResult PageNotFound(IErrorPage page)
 {
     ViewBag.rootUrl = string.Format("{0}://{1}{2}", Request.Url.Scheme, Request.Url.Authority, Url.Content("~"));
     if (page.ErrorCode.Equals("404"))
     {
         PageNotFound model = new PageNotFound()
         {
             ErrorTitle       = page.ErrorTitle,
             ErrorCode        = page.ErrorCode,
             ErrorDescription = page.ErrorDescription
         };
         return(PartialView(CONSTVALUE.PARTIAL_VIEW_ERROR_FOLDER + "_404.cshtml", model));
     }
     return(PartialView("_Error"));
 }
Esempio n. 3
0
 public static IApplicationBuilder UseErrorHandler(this IApplicationBuilder builder, int statusCode,
     IErrorPage page, WebServiceType type)
 {
     return builder.UseMiddleware<ErrorHandler>(statusCode, page, type);
 }