public ActionResult Edit(long?view_id) { using (ViewRepository view_repository = new ViewRepository()) { if (view_id.HasValue) { ViewBag.item = view_repository.GetByID(view_id.Value); } } return(View()); }