bind appsettings

This commit is contained in:
Developer 02
2025-08-14 18:57:27 +02:00
parent fe198615fc
commit 2d8d5442d1
5 changed files with 38 additions and 7 deletions

View File

@@ -27,10 +27,10 @@ public static class DependencyInjection
return services;
}
public static IServiceCollection AddInfrastructureServices(this IServiceCollection services, Action<Config> options)
public static IServiceCollection AddInfrastructureServices(this IServiceCollection services, Action<Config>? options = null)
{
Config config = new(services);
options.Invoke(config);
options?.Invoke(config);
services.ConfigureEConnectClient(config.EConnectClient);
services.AddScoped(typeof(IEConnectClient<>), typeof(EConnectClient<>));
return services;