public ActionResult DeleteConfirmed(int id) { try { _vRepository.Remove(id); return(RedirectToAction("Index")); } catch (Exception ex) { Variant thisVariant = _vRepository.Load(id); ModelState.AddModelError("", ex.Message); return(View(thisVariant)); } }