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
37 lines
1.0 KiB
C#
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 |