Ejemplo n.º 1
0
        public void CreateSalary(SalaryDetails salaryDetails)
        {
            var salary      = Mapper.Map <Salary>(salaryDetails);
            var savedSalary = _salaryRepository.Create(salary);

            foreach (var salaryDeductionDetails in salaryDetails.SalaryDeductions)
            {
                var salaryDeduction = Mapper.Map <SalaryDeduction>(salaryDeductionDetails);
                salaryDeduction.SalaryId = savedSalary.Id;
                _salaryDeductionRepository.Create(salaryDeduction);
            }
        }
Ejemplo n.º 2
0
        public async Task <ActionResult> Create([FromBody] SalaryDto salaryDto)
        {
            var result = await _repo.Create(salaryDto);

            return(Ok(result));
        }