PersistenceServiceRegistration.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using Microsoft.Extensions.DependencyInjection;
  2. using Microsoft.EntityFrameworkCore;
  3. using MTWorkHR.Infrastructure.Data;
  4. using Microsoft.Extensions.Configuration;
  5. using MTWorkHR.Core.IRepositories.Base;
  6. using MTWorkHR.Infrastructure.Repositories;
  7. using MTWorkHR.Core.IRepositories;
  8. using MTWorkHR.Identity.Entities;
  9. using Microsoft.AspNetCore.Identity;
  10. using MTWorkHR.Core.UnitOfWork;
  11. using MTWorkHR.Infrastructure.UnitOfWorks;
  12. using MTWorkHR.Core.Global;
  13. namespace MTWorkHR.Infrastructure
  14. {
  15. public static class PersistenceServiceRegistration
  16. {
  17. public static IServiceCollection AddPersistenceServices2 (this IServiceCollection services, AppSettingsConfiguration configuration)
  18. {
  19. //services.AddDbContext<HRDataContext>(options => {
  20. // options.UseSqlServer(configuration.ConnectionStrings.MTWorkHRConnectionString);
  21. //});
  22. //services.AddScoped(typeof(IRepository<>), typeof(Repository<>));
  23. //services.AddScoped(typeof(IRepositoryLog<>), typeof(RepositoryLog<>));
  24. //services.AddScoped(typeof(IPermissionRepository), typeof(PermissionRepository));
  25. //services.AddScoped(typeof(ICompanyRepository), typeof(CompanyRepository));
  26. //services.AddScoped(typeof(IRolePermissionRepository<RolePermission>), typeof(RolePermissionRepository));
  27. //services.AddScoped(typeof(IUserRoleRepository<IdentityUserRole<string>>), typeof(UserRoleRepository));
  28. //services.AddScoped<IUnitOfWork, UnitOfWork>();
  29. //services.AddScoped<IUnitOfWorkLog, UnitOfWorkLog>();
  30. //services.AddScoped<ApplicationUserManager>();
  31. //services.AddScoped<GlobalInfo>();
  32. //services.AddScoped<IEmployeeRepository, EmployeeRepository>();
  33. return services;
  34. }
  35. }
  36. }