public ActionResult Delete(string id, FormCollection collection) { try { var beer = Repository.Find(id); Repository.Remove(beer); return(RedirectToAction("Index")); } catch (CouchbaseDataException e) { ViewBag.Success = false; ViewBag.Message = e.Message; ViewBag.Status = e.Status; return(View()); } }
public IActionResult DeleteConfirmed(int id) { _repo.Remove(id); _repo.SaveChanges(); return(RedirectToAction(nameof(Index))); }