Exemple #1
0
        public void DeleteLocationWithId(int id)
        {
            var locationToRemove = _db.TblLocation.Find(id);

            if (locationToRemove == null)
            {
                throw new ArgumentException("no Pizza location with that ID", nameof(id));
            }
            _db.Remove(locationToRemove);
        }
        public void DeleteUserWithId(int id)
        {
            var userToRemove = _db.TblUsers.Find(id);

            if (userToRemove == null)
            {
                throw new ArgumentException("no customer with that ID", nameof(id));
            }
            _db.Remove(userToRemove);
        }
        //  This isn't something that the customer should be able to do unless they just placed
        //    order and cancel it before 20 minutes have elapsed
        public void DeleteOrderWithId(int id)
        {
            var orderToRemove = _db.TblUsers.Find(id);

            if (orderToRemove == null)
            {
                throw new ArgumentException("no order with that ID number", nameof(id));
            }
            _db.Remove(orderToRemove);
        }