// GET: 客戶資料/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } var data = repo.GetClient(id.Value); if (data == null) { return(HttpNotFound()); } ViewData.Model = data; return(View()); }