public IActionResult ViewDepartment(int id) { try { return(View(_departmentService .GetDepartmentService(id))); } catch (Exception e) { ViewData["Message"] = e.Message; return(View("Message")); } }
public IActionResult ViewDepartment(int id) { try { Department department = _departmentsService .GetDepartmentService(id); return(View(department)); } catch (Exception e) { return(View("Error", new ErrorViewModel { RequestId = e.Message })); } }