public async Task <AuditoriumSeating> GetAuditoriumSeating(ShowId showId) { var auditoriumDto = await _auditoriumSeatingRepository.GetAuditoriumSeatingFor(showId.Id); var reservedSeatsDto = await _reservationsProvider.GetReservedSeats(showId.Id); return(AdaptAuditoriumSeatingDto(auditoriumDto, reservedSeatsDto)); }
public async Task <AuditoriumSeating> GetAuditoriumSeating(ShowId showId) { // Call the AuditoriumLayout Bounded Context in order to get an empty AuditoriumSeating var auditoriumDtoTask = _auditoriumLayoutProviderWebClient.GetAuditoriumSeatingFor(showId.Id); // Call the SeatReservation Bounded Context to get the list of already reserved seats var reservedSeatsDtoTask = _seatsReservationsProviderWebClient.GetReservedSeats(showId.Id); await Task.WhenAll(auditoriumDtoTask, reservedSeatsDtoTask); var auditoriumDto = auditoriumDtoTask.Result; var reservedSeatsDto = reservedSeatsDtoTask.Result; // Adapt all these information into a type belonging to our SeatSuggestion Bounded Context (External Domains/BCs INFRA => Our Domain) var auditoriumSeating = AdaptAuditoriumSeatingDto(auditoriumDto, reservedSeatsDto); return(auditoriumSeating); }
public async Task <ActionResult <AuditoriumDto> > Get(string showId) { return(await _provideAuditoriumLayouts.GetAuditoriumSeatingFor(showId)); }