public virtual ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } var product = _ElectionService.GetForEdit(id.Value); if (product == null) { return(HttpNotFound()); } return(View(product)); }