Refactor ConfigModel for DI and improved logging
Refactored ConfigModel to use dependency injection for MSSQLServer and ILogger, removed BaseModel inheritance and constructor. Updated using directives and replaced Logger.Error with Logger.LogError for better error handling.
This commit is contained in:
@@ -1,13 +1,10 @@
|
||||
using DigitalData.Modules.Base;
|
||||
using DigitalData.Modules.Database;
|
||||
using EnvelopeGenerator.ServiceHost.Extensions;
|
||||
|
||||
namespace EnvelopeGenerator.ServiceHost.Jobs;
|
||||
|
||||
public class ConfigModel : BaseModel
|
||||
public class ConfigModel(MSSQLServer Database, ILogger Logger)
|
||||
{
|
||||
public ConfigModel(State state) : base(state)
|
||||
{
|
||||
}
|
||||
|
||||
public DbConfig LoadConfiguration()
|
||||
{
|
||||
try
|
||||
@@ -30,7 +27,7 @@ public class ConfigModel : BaseModel
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.Error(ex);
|
||||
Logger.LogError(ex);
|
||||
return new DbConfig();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user