// GET: Purchase/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } if (repo.Details(id) == null) { return(HttpNotFound()); } return(View(repo.Details(id))); }