ApplicationServiceRegistration.cs 819 B

123456789101112131415161718192021222324252627
  1. using MediatR;
  2. using Microsoft.Extensions.DependencyInjection;
  3. using MTWorkHR.Application.Identity;
  4. using MTWorkHR.Application.Services;
  5. using MTWorkHR.Core.Global;
  6. using MTWorkHR.Identity.Services;
  7. using System.Reflection;
  8. namespace MTWorkHR.Application
  9. {
  10. public static class ApplicationServiceRegistration
  11. {
  12. public static IServiceCollection AddApplicationServices(this IServiceCollection services, AppSettingsConfiguration config)
  13. {
  14. services.AddSingleton(config);
  15. services.AddAutoMapper(Assembly.GetExecutingAssembly());
  16. services.AddMediatR(Assembly.GetExecutingAssembly());
  17. services.AddTransient<IAuthService, AuthService>();
  18. services.AddTransient<IUserService, UserService>();
  19. return services;
  20. }
  21. }
  22. }