public ActionResult DeleteConfirmed(int id) { Restaurant restaurant = _db.Query <Restaurant>().Where(x => x.Id == id).FirstOrDefault(); _db.Remove(restaurant); _db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult DeleteConfirmed(int id) { Restaurant restaurant = _db.Query <Restaurant>().Single(r => r.Id == id); _db.Remove(restaurant); _db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult DeleteConfirmed(int id) { Restaurant restaurant = (Restaurant)_db.Query <Restaurant>().Where(r => r.Id.Equals(id)); _db.Remove(restaurant); _db.SaveChanges(); return(RedirectToAction("Index")); }