using DigitalData.UserManager.Application.MappingProfiles; using EnvelopeGenerator.Application.Contracts; using EnvelopeGenerator.Application.MappingProfiles; using EnvelopeGenerator.Application.Configurations; using EnvelopeGenerator.Application.Services; using EnvelopeGenerator.Infrastructure.Contracts; using EnvelopeGenerator.Infrastructure.Repositories; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; namespace EnvelopeGenerator.Application { public static class DIExtensions { public static IServiceCollection AddEnvelopeGenerator(this IServiceCollection services, IConfiguration dispatcherConfigSection, IConfiguration mailConfigSection) { //Inject CRUD Service and repositoriesad services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); //Auto mapping profiles services.AddAutoMapper(typeof(BasicDtoMappingProfile).Assembly); services.AddAutoMapper(typeof(UserMappingProfile).Assembly); services.Configure(dispatcherConfigSection); services.Configure(mailConfigSection); return services; } public static IServiceCollection AddEnvelopeGenerator(this IServiceCollection services, IConfiguration config) => services.AddEnvelopeGenerator( dispatcherConfigSection: config.GetSection("DispatcherConfig"), mailConfigSection: config.GetSection("MailConfig")); } }