diff --git a/EnvelopeGenerator.Application/Extensions/DIExtensions.cs b/EnvelopeGenerator.Application/Extensions/DIExtensions.cs index 6ebadb61..f5156fdf 100644 --- a/EnvelopeGenerator.Application/Extensions/DIExtensions.cs +++ b/EnvelopeGenerator.Application/Extensions/DIExtensions.cs @@ -11,64 +11,59 @@ using Microsoft.Extensions.DependencyInjection.Extensions; using DigitalData.Core.Client; using QRCoder; -namespace EnvelopeGenerator.Application.Extensions +namespace EnvelopeGenerator.Application.Extensions; + +public static class DIExtensions { - public static class DIExtensions + public static IServiceCollection AddEnvelopeGenerator(this IServiceCollection services, IConfiguration config) { - public static IServiceCollection AddEnvelopeGenerator(this IServiceCollection services, IConfiguration config) - { - //Inject CRUD Service and repositoriesad - services.TryAddScoped(); - services.TryAddScoped(); - services.TryAddScoped(); - services.TryAddScoped(); - services.TryAddScoped(); - services.TryAddScoped(); - services.TryAddScoped(); - services.TryAddScoped(); - services.TryAddScoped(); - services.TryAddScoped(); - services.TryAddScoped(); - services.TryAddScoped(); - services.TryAddScoped(); - services.TryAddScoped(); - services.TryAddScoped(); - services.TryAddScoped(); - services.TryAddScoped(); - services.TryAddScoped(); - services.TryAddScoped(); - services.TryAddScoped(); - services.TryAddScoped(); - services.TryAddScoped(); - services.TryAddScoped(); - services.TryAddScoped(); - services.TryAddScoped(); - services.TryAddScoped(); - services.TryAddScoped(); - services.TryAddScoped(); - services.TryAddScoped(); - services.TryAddScoped(); + //Inject CRUD Service and repositoriesad + services.TryAddScoped(); + services.TryAddScoped(); + services.TryAddScoped(); + services.TryAddScoped(); + services.TryAddScoped(); + services.TryAddScoped(); + services.TryAddScoped(); + services.TryAddScoped(); + services.TryAddScoped(); + services.TryAddScoped(); + services.TryAddScoped(); + services.TryAddScoped(); + services.TryAddScoped(); + services.TryAddScoped(); + services.TryAddScoped(); + services.TryAddScoped(); + services.TryAddScoped(); + services.TryAddScoped(); + services.TryAddScoped(); + services.TryAddScoped(); + services.TryAddScoped(); + services.TryAddScoped(); + services.TryAddScoped(); + services.TryAddScoped(); + services.TryAddScoped(); + services.TryAddScoped(); + services.TryAddScoped(); + services.TryAddScoped(); + services.TryAddScoped(); + services.TryAddScoped(); - //Auto mapping profiles - services.AddAutoMapper(typeof(BasicDtoMappingProfile).Assembly); - services.AddAutoMapper(typeof(UserMappingProfile).Assembly); + //Auto mapping profiles + services.AddAutoMapper(typeof(BasicDtoMappingProfile).Assembly); + services.AddAutoMapper(typeof(UserMappingProfile).Assembly); - services.ConfigureByTypeName(config); - services.ConfigureByTypeName(config); - services.ConfigureByTypeName(config); - services.ConfigureByTypeName(config); + services.Configure(config.GetSection(nameof(DispatcherParams))); + services.Configure(config.GetSection(nameof(MailParams))); + services.Configure(config.GetSection(nameof(AuthenticatorParams))); + services.Configure(config.GetSection(nameof(TotpSmsParams))); - services.AddHttpClientService(config.GetSection(nameof(GtxMessagingParams))); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); + services.AddHttpClientService(config.GetSection(nameof(GtxMessagingParams))); + services.TryAddSingleton(); + services.TryAddSingleton(); + services.TryAddSingleton(); + services.TryAddSingleton(); - return services; - } - - //TODO: move to DigitalData.Core - private static IServiceCollection ConfigureByTypeName(this IServiceCollection services, IConfiguration configuration) where TOptions : class - => services.Configure(configuration.GetSection(nameof(TOptions))); + return services; } } \ No newline at end of file