InfrastructureServiceRegistration.cs 825 B

1234567891011121314151617181920212223
  1. using Microsoft.Extensions.DependencyInjection;
  2. using Microsoft.Extensions.Configuration;
  3. using MTWorkHR.Application.Models.Email;
  4. using MTWorkHR.Infrastructure.EmailService;
  5. using MTWorkHR.Application.Logging;
  6. using MTWorkHR.Infrastructure.Logging;
  7. using MTWorkHR.Application.Services;
  8. using MTWorkHR.Core;
  9. namespace MTWorkHR.Infrastructure
  10. {
  11. public static class InfrastructureServiceRegistration
  12. {
  13. public static IServiceCollection AddInfrastructureServices (this IServiceCollection services, IConfiguration configuration){
  14. services.Configure<EmailSettings>(configuration.GetSection("MailSettings"));
  15. services.AddTransient<IEmailSender, EmailSender>();
  16. services.AddScoped(typeof(IAppLogger<>), typeof(LoggerAdapter<>));
  17. return services;
  18. }
  19. }
  20. }