using DigitalData.Core.Client;
using EnvelopeGenerator.Application.Common.Configurations;
using EnvelopeGenerator.Application.Common.Interfaces.Services;
using EnvelopeGenerator.Application.Services;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using QRCoder;
using System.Reflection;
namespace EnvelopeGenerator.Application;
///
/// Extensions method for dependency injection
///
public static class DependencyInjection
{
///
/// Adds all required services for envelope generator application
///
///
///
///
[Obsolete("Use MediatR")]
public static IServiceCollection AddEnvelopeGeneratorServices(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();
//Auto mapping profiles
services.AddAutoMapper(Assembly.GetExecutingAssembly());
services.AddAutoMapper(typeof(DigitalData.UserManager.Application.DIExtensions));
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.AddMediatR(cfg =>
{
cfg.RegisterServicesFromAssembly(Assembly.GetExecutingAssembly());
});
return services;
}
}