16.01.24
This commit is contained in:
@@ -6,6 +6,7 @@ namespace EnvelopeGenerator.Web.Services
|
||||
public class DatabaseService: BaseService
|
||||
{
|
||||
public MSSQLServer MSSQL { get; set; }
|
||||
public IConfiguration Config { get; set; }
|
||||
|
||||
public State State { get; set; }
|
||||
|
||||
@@ -47,12 +48,13 @@ namespace EnvelopeGenerator.Web.Services
|
||||
public readonly ModelContainer? Models;
|
||||
public readonly ServiceContainer? Services;
|
||||
|
||||
public DatabaseService(IConfiguration Config, LoggingService Logging) : base(Config, Logging)
|
||||
public DatabaseService(IConfiguration pConfig, LoggingService pLogging) : base(pConfig, pLogging)
|
||||
{
|
||||
logger = Logging.LogConfig.GetLogger();
|
||||
logger = pLogging.LogConfig.GetLogger();
|
||||
Config = pConfig;
|
||||
|
||||
logger.Debug("Establishing MSSQL Database connection..");
|
||||
MSSQL = new MSSQLServer(logConfig, Config["Config:ConnectionString"]);
|
||||
MSSQL = new MSSQLServer(logConfig, pConfig["Config:ConnectionString"]);
|
||||
|
||||
if (MSSQL.DBInitialized == true)
|
||||
{
|
||||
@@ -71,6 +73,11 @@ namespace EnvelopeGenerator.Web.Services
|
||||
}
|
||||
}
|
||||
|
||||
public string? GetAppSetting(string key)
|
||||
{
|
||||
return Config[key];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// There is a circular dependency between state and models
|
||||
/// All models need a state object, including the config Model
|
||||
|
||||
Reference in New Issue
Block a user