var showTime = ShowTimes.Where(x => x.ShowTimeID == request.ShowTimeId).FirstOrDefault();
int totalTicketsRequested = request.RequireTickets.Count();
if (showTime.Theatre.SeatingSize < totalTicketsRequested)
{
throw new Exception("There are not enough seats available for this purchase");
}
var showTime = ShowTimes.Where(x => x.ShowTimeID == request.ShowTimeId).FirstOrDefault();
int totalTicketsRequested = request.RequireTickets.Count();
if (showTime.Theatre.SeatingSize < totalTicketsRequested)
{
throw new Exception("There are not enough seats available for this purchase");
}
With the code shown I am trying to grab the showtimeID the user selected and use it to figure out the seating size of the theatre to ensure the total tickets selected by the user don't exceed the seating size