Refactor envelope generator service dependencies
This commit replaces the `AddEnvelopeGeneratorRepositories` method with `AddEnvelopeGeneratorInfrastructureServices`, allowing for more flexible configuration through `IConfiguration` and `Action<SQLExecutorParams>`. The `SQLExecutor` class now utilizes `SQLExecutorParams` for its connection string, enhancing configurability. A new `SQLExecutorParams` class has been introduced to encapsulate connection string management. Various service registration calls have been updated to integrate the new infrastructure services, improving modularity and ease of database connection management.
This commit is contained in:
@@ -27,11 +27,11 @@ public static class DependencyInjection
|
||||
});
|
||||
|
||||
// Add envelope generator services
|
||||
services.AddEnvelopeGeneratorRepositories(options => options.UseSqlServer(connStr));
|
||||
services.AddEnvelopeGeneratorInfrastructureServices(options => options.UseSqlServer(connStr));
|
||||
|
||||
return services
|
||||
.AddSingleton<CommandManager>()
|
||||
.AddEnvelopeGeneratorRepositories()
|
||||
.AddEnvelopeGeneratorInfrastructureServices()
|
||||
.AddEnvelopeGeneratorServices(configuration)
|
||||
.AddSingleton(sp =>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user