public ActionResult Details(int?id) { if (id == null) { throw new Exception("need commodity id"); } Commodity commodity = iCommodityService.Find <Commodity>(id ?? -1); if (commodity == null) { throw new Exception("Not Found Commodity"); } return(View(commodity)); }