Exemplo n.º 1
0
        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());
        }
Exemplo n.º 2
0
        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);
        }