Mike Phares 83789cdd91 Added ControllerExtensions to be used instead of HtmlViewRenderer for net8
Added HttpException class for missing HttpException for net8

Wrapped HttpContext.Session, GetJsonResult, IsAjaxRequest and GetUserIdentityName in controllers for net8

Added AuthenticationService to test Fab2ApprovalMKLink code for net8

Compile conditionally flags to debug in dotnet core
2025-05-19 13:29:54 -07:00

37 lines
1.0 KiB
C#

#if NET8
using System;
namespace Fab2ApprovalSystem.Models;
public class HttpException : Exception {
private readonly int httpStatusCode;
public HttpException(int httpStatusCode) {
this.httpStatusCode = httpStatusCode;
}
public HttpException(System.Net.HttpStatusCode httpStatusCode) {
this.httpStatusCode = (int)httpStatusCode;
}
public HttpException(int httpStatusCode, string message) : base(message) {
this.httpStatusCode = httpStatusCode;
}
public HttpException(System.Net.HttpStatusCode httpStatusCode, string message) : base(message) {
this.httpStatusCode = (int)httpStatusCode;
}
public HttpException(int httpStatusCode, string message, Exception inner) : base(message, inner) {
this.httpStatusCode = httpStatusCode;
}
public HttpException(System.Net.HttpStatusCode httpStatusCode, string message, Exception inner) : base(message, inner) {
this.httpStatusCode = (int)httpStatusCode;
}
public int StatusCode { get { return httpStatusCode; } }
}
#endif