Exemplo n.º 1
0
        public IHttpActionResult Delete(int id)
        {
            // delete reservationstablepackages
            // delete reservations
            _reservationsController.DeleteByVenueId(id);

            // delete tablepackages
            _tablePackagesController.DeleteByVenueId(id);

            // delete tables
            _tablesController.DeleteByVenueId(id);

            // delete venuehours
            _venueHoursController.DeleteByVenueId(id);

            // delete beverages
            _beveragesController.DeleteByVenueId(id);

            _venueEmployeesController.DeleteByVenueId(id);


            if (_venueRepository.Delete(id))
            {
                return(Ok("Venue was deleted"));
            }
            else
            {
                return(BadRequest("Something went wrong .."));
            }
        }