示例#1
0
        public async Task <Employee> GetEmployeeById(int idEmployee)
        {
            try
            {
                EmployeeSalary emp = await _employeeRepository.GetEmployeeById(idEmployee);

                return(emp != null?EmployeeFactory.GetFullEmployee(emp) : null);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                throw;
            }
        }
示例#2
0
        public async Task <List <Employee> > GetEmployees()
        {
            try
            {
                List <EmployeeSalary> employees = await _employeeRepository.GetEmployees();

                List <Employee> lstEmployee = new List <Employee>();
                foreach (var emp in employees)
                {
                    Employee employee = EmployeeFactory.GetFullEmployee(emp);
                    lstEmployee.Add(employee);
                }
                return(lstEmployee);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                throw;
            }
        }