Esempio n. 1
0
        public async Task <IEnumerable <EmployeeDto> > GetEmployeeAll()
        {
            var employees = await this.employeeRepository.GetAll();

            if (employees.Count() > 0)
            {
                return(employees.Select(e => FactoryEmployee.GetEmployeeDto(e)));
            }
            return(null);
        }
Esempio n. 2
0
        public async Task <EmployeeDto> GetEmployee(int id)
        {
            var employee = await this.employeeRepository.GetById(id);

            if (employee != null)
            {
                return(FactoryEmployee.GetEmployeeDto(employee));
            }
            return(null);
        }