public IActionResult Retrieve(int?id) { if (null == id) { return(BadRequest()); } var emp = companyDB.Employees.Find(id); if (null == emp) { return(NotFound()); } CreateModel model = new CreateModel() { Employee = emp, DepartmentName = companyDB.GetDeparmentById(emp.DepartmentId).Name }; return(View(model)); }