public IActionResult Get(int showingId = 0, bool includeReservations = false) { IActionResult foundToReturn; Showing foundShowing; List <SeatBooking> seatBookings; ShowingDataControl sControl = new ShowingDataControl(_configuration); SeatBookingDataControl sbControl = new SeatBookingDataControl(_configuration); foundShowing = sControl.GetShowingViewById(showingId); if (foundShowing != null && includeReservations) { seatBookings = sbControl.GetSeatBookings(showingId); if (seatBookings != null) { foundShowing.SeatBookings = seatBookings; } else { foundToReturn = new StatusCodeResult(500); } } if (foundShowing != null) { foundToReturn = Ok(foundShowing); } else { foundToReturn = NotFound(); } return(foundToReturn); }
public IActionResult Delete(int showingId) { IActionResult foundToReturn; ShowingDataControl showingDataControl = new ShowingDataControl(_configuration); bool wasOk = showingDataControl.Delete(showingId); if (wasOk) { foundToReturn = Ok(); } else { foundToReturn = new StatusCodeResult(200); } return(foundToReturn); }
public ShowingsController(IConfiguration inConfiguration) { _configuration = inConfiguration; _sControl = new ShowingDataControl(_configuration); }