public async Task <IEnumerable <Employee> > GetEmployeesAsync() { IEnumerable <Employee> employees = null; IEnumerable <EmployeeContract> employeeList = await GetEmployees(); employees = employeeList.Select(e => EmployeeFactory.CreateEmpleyee(e)); return(employees.AsEnumerable()); }
public async Task <Employee> GetEmployeeAsync(int id) { Employee employee = null; IEnumerable <EmployeeContract> employeeList = await GetEmployees(); employee = employeeList.Select(e => EmployeeFactory.CreateEmpleyee(e)) .Where(e => e.Id == id).SingleOrDefault(); return(employee); }