예제 #1
0
        public async Task <ActionResult <EmployeeGetModel> > GetEmployee(int id)
        {
            try
            {
                var employeeResult = await _getEmployeeQuery.Execute(id);

                if (employeeResult != null)
                {
                    return(Ok(employeeResult));
                }
                else
                {
                    return(NotFound());
                }
            }
            catch (Exception ex)
            {
                _logger.Error(ex, ex.Message, null);
                return(StatusCode(StatusCodes.Status500InternalServerError));
            }
        }
예제 #2
0
        // GET: Employee/Details/5
        public ActionResult Details(int id)
        {
            var employeeModel = _employeeQuery.Execute(id);

            return(View(employeeModel));
        }