Example #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Restaurant restaurant = _db.Query <Restaurant>().Where(x => x.Id == id).FirstOrDefault();

            _db.Remove(restaurant);
            _db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #2
0
        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"));
        }