コード例 #1
0
        public ActionResult Delete(int id)
        {
            var reservation = _dataService.GetReservation(id);
            var model       = reservation.ConvertToReservationViewModel();

            if (!model.CanDelete())
            {
                throw new Exception("Not allowed");
            }

            _dataService.DeleteReservation(reservation);

            return(RedirectToAction("Index"));
        }