public CompanySettingsService(ICompanySettingsRepository repository, ICompanyRepository companyRepository, ITenantManager tenantManager) : base(repository) { _repository = repository; _companyRepository = companyRepository; _tenantManager = tenantManager; }
public TenantManager(ITenantRepository tenantRepository, ICompanyRepository companyRepository, IBranchRepository branchRepository, ISupplierRepository supplierRepository, IWarehouseRepository warehouseRepository, ISubscriptionRepository subscriptionRepository, IEditionRepository editionRepository, ICompanySettingsRepository companySettingsRepository, ISubscriptionPaymentRepository subscriptionPaymentRepository, ISmsService smsService, ICustomerRepository customerRepository, IUserService userService, RoleManager roleManager, IEmployeeRepository employeeRepository, ISecurityRepository <Role, string> roleRepository) { _tenantRepository = tenantRepository; _companyRepository = companyRepository; _branchRepository = branchRepository; _supplierRepository = supplierRepository; _warehouseRepository = warehouseRepository; _subscriptionRepository = subscriptionRepository; _editionRepository = editionRepository; _companySettingsRepository = companySettingsRepository; _subscriptionPaymentRepository = subscriptionPaymentRepository; _smsService = smsService; _userService = userService; _roleManager = roleManager; _userManager = HttpContext.Current?.GetOwinContext()?.GetUserManager <UserManager>(); _employeeRepository = employeeRepository; _roleRepository = roleRepository; _customerRepository = customerRepository; var tenantId = HttpContext.Current?.Request.Headers["TenantId"]; _userManager?.SetTenantId(string.IsNullOrWhiteSpace(tenantId) ? null : tenantId); }