/// <summary> /// 查看详细信息 /// </summary> /// <param name="id"></param> /// <returns></returns> // GET: Employees/Details/5 public async Task <IActionResult> Details(int?id) { if (id == null) { return(NotFound()); } /* * var employee = await _context.Employee * .FirstOrDefaultAsync(item => item.Id == id); */ Employee employee = await EmployeesService.FindEmployeeByIdAsync(id); if (employee == null) { return(NotFound()); } return(View(employee)); }