コード例 #1
0
 public EmployeeBenefitsController(IOptionsMonitor <ApiSettings> settings, IEmployeeRepository employeeRepository, IDependentRepository dependentRepository, IBenefitsRepository benefitsRepository)
 {
     _settings            = settings.CurrentValue;
     _employeeRepository  = employeeRepository;
     _dependentRepository = dependentRepository;
     _benefitsRepository  = benefitsRepository;
 }
コード例 #2
0
 public AdminController(EmployeeRepository employeeRepository,
                        DependentRepository dependentRepository,
                        BenefitSettingsRepository benefitSettingsRepository,
                        DiscountRepository discountRepository,
                        DiscountTypeRepository discountTypeRepository,
                        DiscountConditionTypeRepository discountConditionTypeRepository,
                        StateRepository stateRepository)
 {
     EmployeeRepository              = employeeRepository;
     DependentRepository             = dependentRepository;
     BenefitSettingsRepository       = benefitSettingsRepository;
     DiscountRepository              = discountRepository;
     DiscountTypeRepository          = discountTypeRepository;
     DiscountConditionTypeRepository = discountConditionTypeRepository;
     StateRepository = stateRepository;
 }
コード例 #3
0
        protected virtual void Dispose(bool disposing)
        {
            if (_disposed)
            {
                return;
            }

            if (disposing)
            {
                // free other managed objects that implement IDisposable only
                _repository.Dispose();
            }

            // release any unmanaged objects set the object references to null
            _repository = null;

            _disposed = true;
        }
コード例 #4
0
 public async Task <Dependent> GetDependentAsync(IDependentRepository dependetRepository, Guid dependentId)
 {
     //todo: add logs and error checking
     return(await dependetRepository.GetDependentAsync(dependentId));
 }
コード例 #5
0
 public async Task UpdateDependetAsync(IDependentRepository dependetRepository, UpdateDependentModel dependetToUpdate)
 {
     //todo: add logs and error checking
     await dependetRepository.UpdateDependentAsync(dependetToUpdate);
 }
コード例 #6
0
 public DependentDomain(IDependentRepository repository)
 {
     _repository = repository;
 }
コード例 #7
0
 public UpsertDependentHandler(IDependentRepository dependentRepository, IMapper mapper)
 {
     _dependentRepository = dependentRepository ?? throw new ArgumentNullException(nameof(dependentRepository));
     _mapper = mapper ?? throw new ArgumentNullException(nameof(mapper));
 }
コード例 #8
0
 public DependentComponent(IDependentRepository dependentRepository, IMapper mapper)
 {
     _dependentRepository = dependentRepository;
     _mapper = mapper;
 }
コード例 #9
0
        private async Task <List <InputEmployee> > GetInputEmployees(List <Employee> employees, IDependentRepository dependentRepository)
        {
            var inputEmployees = new List <InputEmployee>();

            foreach (var employee in employees)
            {
                var eTemp = new InputEmployee();
                eTemp.Id   = employee.Id;
                eTemp.Name = $"{employee.FirstName} {employee.LastName}";

                employee.Dependents = await dependentRepository.GetAllEmployeeDependentsAsync(employee.Id);

                foreach (var d in employee.Dependents)
                {
                    var dTemp = new InputDependent();
                    dTemp.Id   = d.Id;
                    dTemp.Name = $"{d.FirstName} {d.LastName}";
                    eTemp.InputDependents.Add(dTemp);
                }
                inputEmployees.Add(eTemp);
            }
            return(inputEmployees);
        }
コード例 #10
0
        public async Task <List <EmpDependetsBenefitDetails> > GetEmployeeWithCurrentSalaryAsync(IEmployeeRepository employeeRepository, IDependentRepository dependentRepository, IBenefitsRepository benefitsRepository)
        {
            var employees = await employeeRepository.GetAllEmployeesAsync();

            var inputEmployees = await GetInputEmployees(employees, dependentRepository);

            var medBenefits = await benefitsRepository.GetEmployeeMedBenefitsAsync(inputEmployees);

            medBenefits = AppendCurrentSalary(employees, medBenefits);

            return(medBenefits);
        }
コード例 #11
0
        public async Task <Employee> GetEmployeeWithDependentsAsync(IEmployeeRepository employeeRepository, IDependentRepository dependentRepository, Guid employeeId)
        {
            var employee = await employeeRepository.GetEmployeeWithDependentsAsync(employeeId);

            employee.Dependents = await dependentRepository.GetAllEmployeeDependentsAsync(employeeId);

            return(employee);
        }
コード例 #12
0
 public UnitOfWork(ApplicationDbContext context)
 {
     _context   = context;
     Employees  = new EmployeeRepository(context);
     Dependents = new DependentRepository(context);
 }
コード例 #13
0
 public DependentController(IDependentRepository repository)
 {
     this.repository = repository;
 }
コード例 #14
0
 public EmployeeCommandHandler(IEmployeeRepository employeeRepository, IDependentRepository dependentRepository, IUnitOfWork unitOfWork)
 {
     _employeeRepository  = employeeRepository;
     _unitOfWork          = unitOfWork;
     _dependentRepository = dependentRepository;
 }
コード例 #15
0
 public async Task AddDependetAsync(IDependentRepository dependetRepository, AddDependentModel addDependentModel)
 {
     //todo: add logs and error checking
     await dependetRepository.AddDependentAsync(addDependentModel);
 }
コード例 #16
0
 public EmployeeDomain(IEmployeeRepository repository, IDependentRepository repositoryDependent)
 {
     _repository          = repository;
     _repositoryDependent = repositoryDependent;
 }
コード例 #17
0
 public EmployeeSeedBucketAction(IEmployeeRepository employeeRepository, IDependentRepository dependentRepository)
 {
     _employeeRepository  = employeeRepository ?? throw new ArgumentNullException(nameof(employeeRepository));
     _dependentRepository = dependentRepository ?? throw new ArgumentNullException(nameof(dependentRepository));
 }
コード例 #18
0
 public DependentController(IDependentRepository dependentRepository)
 {
     _dependentRepository = dependentRepository;
 }
コード例 #19
0
 public DependentService(IDependentRepository dependentRepository)
 {
     _dependentRepository = dependentRepository;
 }
 public DependentRepositoryFixture()
 {
     _repository = new DependentRepository(Context);
     _builder    = new DependentBuilder();
     _helper     = new DependentHelper(Context);
 }