// GET: Todoes/Details/5 public ActionResult Details(int? id) { if (id == null) { return new HttpStatusCodeResult(HttpStatusCode.BadRequest); } Todo todo = db.Todoes.Find(id); if (todo == null) { return HttpNotFound(); } return View(todo); } Detailsメソッドの定義です。 int? は int の Nullable型 です。 通常の int は null を設定できませんが、Nullable型は null が許容されます。 RouteConfig.cs の defaults の定義により、idは省略可能です。 id が省略された場合、Details