public EmployeeDTO GetEmployeeById(int pId) { var employee = dataClient.GetEmployeeById(pId); if (employee != null) { return(EmployeeFactory.GetEmployeeBySalaryType(employee)); } else { throw new EmployeeNotFoundException("Employee not found"); } }
public List <EmployeeDTO> GetEmployees() { List <EmployeeDTO> employeeList = new List <EmployeeDTO>(); var employees = dataClient.GetEmployees(); if (employees != null) { foreach (var employee in employees) { employeeList.Add(EmployeeFactory.GetEmployeeBySalaryType(employee)); } } return(employeeList); }