public ActionResult DeleteConfirmed(int id) { Navigation navigation = NavigationRepository.GetSingle(id); try { NavigationRepository.Delete(navigation); NavigationRepository.Save(); if (IsSuperAdmin) { return(RedirectToAction("Index", new { storeId = navigation.StoreId })); } else { return(RedirectToAction("Index")); } } catch (Exception ex) { Logger.Error(ex, "Unable to delete:" + ex.StackTrace, navigation); //Log the error (uncomment dex variable name and add a line here to write a log. ModelState.AddModelError("", "Unable to save changes. Try again, and if the problem persists see your system administrator."); } return(View(navigation)); }