Beispiel #1
0
        public async Task <EmployeeDTO> GetById(int id)
        {
            var employees = await _employeeRepository.GetAllAsync();

            EmployeeDTO         employee        = employees.Where(i => i.Id == id).FirstOrDefault();
            BaseEmployeeFactory employeeFactory = new EmployeeFactory().CreateFactory(employee);

            employeeFactory.AnnualSalary();
            return(employee);
        }
Beispiel #2
0
        public async Task <IEnumerable <EmployeeDTO> > GetAll()
        {
            var employees = await _employeeRepository.GetAllAsync();

            foreach (EmployeeDTO employee in employees)
            {
                BaseEmployeeFactory employeeFactory = new EmployeeFactory().CreateFactory(employee);
                employeeFactory.AnnualSalary();
            }
            return(employees);
        }