public IActionResult GetAll()
        {
            var allEmployee = _employeeDAO.GetAll();

            if (allEmployee.Count != 0)
            {
                return(Ok(allEmployee));
            }

            return(NotFound("No employee exit yet."));
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        public ICollection <EmployeeViewModel> GetAllViewModels()
        {
            var employees = employeeDataAccessObject.GetAll();

            return(employees.Select(e => new EmployeeViewModel(e)).ToList());
        }