ApplicationServiceRegistration.cs 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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<IContractTaskAttachmentService, ContractTaskAttachmentService>();
  36. services.AddScoped<IProjectStageAttachmentService, ProjectStageAttachmentService>();
  37. services.AddScoped<IOTPService, OTPService>();
  38. services.AddScoped<ILogService<UserLog>, LogService<UserLog>>();
  39. return services;
  40. }
  41. }
  42. }