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
22 lines
536 B
C#
22 lines
536 B
C#
using System.Data;
|
|
|
|
using Fab2ApprovalSystem.Models;
|
|
|
|
using Microsoft.Data.SqlClient;
|
|
|
|
namespace Fab2ApprovalSystem.Services;
|
|
|
|
public interface IDbConnectionService {
|
|
IDbConnection GetConnection();
|
|
}
|
|
|
|
public class DbConnectionService : IDbConnectionService {
|
|
private readonly string _dbConnectionString;
|
|
|
|
public DbConnectionService(AppSettings appSettings) {
|
|
_dbConnectionString = appSettings.DBConnectionString;
|
|
}
|
|
|
|
public IDbConnection GetConnection() =>
|
|
new SqlConnection(_dbConnectionString);
|
|
} |