public IActionResult GetAll() { var allEmployee = _employeeDAO.GetAll(); if (allEmployee.Count != 0) { return(Ok(allEmployee)); } return(NotFound("No employee exit yet.")); }
public ICollection <EmployeeViewModel> GetAllViewModels() { ICollection <EmployeeViewModel> toTransfer = new List <EmployeeViewModel>(); ICollection <EmployeeModel> employees = employeeDataAccessObject.GetAll(); foreach (EmployeeModel e in employees) { toTransfer.Add(new EmployeeViewModel(e)); } return(toTransfer); }
public ICollection <EmployeeViewModel> GetAllViewModels() { var employees = employeeDataAccessObject.GetAll(); return(employees.Select(e => new EmployeeViewModel(e)).ToList()); }