public ActionResult Delete(int number) { ListGameDetails listGameDetails = _db.ListGameDB.Find(number); _db.ListGameDB.Remove(listGameDetails); _db.SaveChanges(); return(RedirectToAction("Index")); }
//GET : Delete //Game/Delete/{name} public ActionResult Delete(int?number) { if (number == null) { return(new HttpStatusCodeResult(System.Net.HttpStatusCode.BadRequest)); } ListGameDetails listGameDetails = _db.ListGameDB.Find(number); if (listGameDetails == null) { return(HttpNotFound()); } return(View(listGameDetails)); }