ApplicationServiceRegistration.cs 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using MediatR;
  2. using Microsoft.Extensions.DependencyInjection;
  3. using MTWorkHR.Application.Identity;
  4. using MTWorkHR.Application.Services;
  5. using MTWorkHR.Application.Services.Interfaces;
  6. using MTWorkHR.Core.Entities;
  7. using MTWorkHR.Core.Global;
  8. using MTWorkHR.Identity.Services;
  9. using System.Reflection;
  10. namespace MTWorkHR.Application
  11. {
  12. public static class ApplicationServiceRegistration
  13. {
  14. public static IServiceCollection AddApplicationServices(this IServiceCollection services, AppSettingsConfiguration config)
  15. {
  16. services.AddSingleton(config);
  17. services.AddAutoMapper(Assembly.GetExecutingAssembly());
  18. services.AddMediatR(Assembly.GetExecutingAssembly());
  19. services.AddScoped<IAuthService, AuthService>();
  20. services.AddScoped<IUserService, UserService>();
  21. // services.AddTransient<IFileService, FileService>();
  22. services.AddScoped<IFileService, BlobFileService>();
  23. services.AddScoped<IProjectService, ProjectService>();
  24. services.AddScoped<IUserTaskService, UserTaskService>();
  25. services.AddScoped<IUserTaskAttachmentService, UserTaskAttachmentService>();
  26. services.AddScoped<IUserTaskHistoryService, UserTaskHistoryService>();
  27. services.AddScoped<ITeamService, TeamService>();
  28. services.AddScoped<IMeetingService, MeetingService>();
  29. services.AddScoped<IAttendanceService, AttendanceService>();
  30. services.AddScoped<IOrderAllocationService, OrderAllocationService>();
  31. services.AddScoped<IOrderRequestService, OrderRequestService>();
  32. services.AddScoped<ILookupService, LookupService>();
  33. services.AddScoped<ICompanyService, CompanyService>();
  34. services.AddScoped<IContractService, ContractService>();
  35. services.AddScoped<IOTPService, OTPService>();
  36. services.AddScoped<ILogService<UserLog>, LogService<UserLog>>();
  37. return services;
  38. }
  39. }
  40. }