InfrastructureServiceRegistrationOld.cs 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. using Microsoft.Extensions.DependencyInjection;
  2. using Microsoft.Extensions.Configuration;
  3. using MTWorkHR.Infrastructure.EmailService;
  4. using MTWorkHR.Infrastructure.Logging;
  5. using MTWorkHR.Core.Global;
  6. using Microsoft.AspNetCore.Identity;
  7. using Microsoft.EntityFrameworkCore;
  8. using MTWorkHR.Core.IRepositories.Base;
  9. using MTWorkHR.Core.IRepositories;
  10. using MTWorkHR.Core.UnitOfWork;
  11. using MTWorkHR.Infrastructure.Data;
  12. using MTWorkHR.Infrastructure.Repositories;
  13. using MTWorkHR.Infrastructure.UnitOfWorks;
  14. using MTWorkHR.Core.Email;
  15. namespace MTWorkHR.Infrastructure
  16. {
  17. public static class InfrastructureServiceRegistration
  18. {
  19. public static IServiceCollection AddInfrastructureServices (this IServiceCollection services, AppSettingsConfiguration configuration){
  20. services.AddDbContext<HRDataContext>(options => {
  21. options.UseSqlServer(configuration.ConnectionStrings.MTWorkHRConnectionString);
  22. });
  23. //services.AddScoped(typeof(IRepository<>), typeof(Repository<>));
  24. //services.AddScoped(typeof(IRepositoryLog<>), typeof(RepositoryLog<>));
  25. //services.AddScoped(typeof(ICompanyRepository), typeof(CompanyRepository));
  26. //services.AddScoped(typeof(IProjectRepository), typeof(ProjectRepository));
  27. //services.AddScoped(typeof(ITaskStatusRepository), typeof(TaskStatusRepository));
  28. //services.AddScoped(typeof(IUserTaskRepository), typeof(UserTaskRepository));
  29. //services.AddScoped(typeof(IUserTaskHistoryRepository), typeof(UserTaskHistoryRepository));
  30. //services.AddScoped(typeof(IPermissionRepository), typeof(PermissionRepository));
  31. //services.AddScoped(typeof(IRolePermissionRepository<RolePermission>), typeof(RolePermissionRepository));
  32. //services.AddScoped(typeof(IUserRoleRepository<IdentityUserRole<string>>), typeof(UserRoleRepository));
  33. //services.AddScoped<IUnitOfWork, UnitOfWork>();
  34. //services.AddScoped<IUnitOfWorkLog, UnitOfWorkLog>();
  35. //services.AddTransient<IMailSender, MailSender>();
  36. //services.AddScoped<ApplicationUserManager>();
  37. //services.AddScoped<GlobalInfo>();
  38. //services.AddScoped<IEmployeeRepository, EmployeeRepository>();
  39. //services.AddScoped(typeof(IAppLogger<>), typeof(LoggerAdapter<>));
  40. return services;
  41. }
  42. }
  43. }