Exemplo n.º 1
0
        public ActionResult <EmployeeDto> GetEmployee(string employeeId)
        {
            try
            {
                if (!_recordsRepository.EmployeeExists(employeeId))
                {
                    return(NotFound());
                }

                var employee = _recordsRepository.GetEmployee(employeeId);

                return(Ok(_mapper.Map <EmployeeDto>(employee)));
            }
            catch
            {
                return(StatusCode(StatusCodes.Status500InternalServerError));
            }
        }