We have code like this and seem to get inconstant results(meaning that sometimes no results are returned, they are all 0 counts!) when called in production. I was wondering would the await calls after the WaitAll causes issues as it seems like we should maybe be calling .Result
?
For example when we call the below, should we be calling .Result instead.
Destinations = await arrivalsDestinations,
After doing the Task.WhenAll
Example code here:
var inHouseDestinations = GetDestinationPax(destinations, PaxPassengerLocation.InHouse, destinationFacet);
var arrivalsDestinations = GetDestinationPax(destinations, PaxPassengerLocation.Arrivals, destinationFacet);
var arrivalsTomorrowDestinations = GetDestinationPax(destinations, PaxPassengerLocation.ArrivalsTomorrow, destinationFacet);
var departuresDestinations = GetDestinationPax(destinations, PaxPassengerLocation.Departures, destinationFacet);
await Task.WhenAll(
inHouseDestinations, arrivalsDestinations, arrivalsTomorrowDestinations, departuresDestinations);
var arrivalsSummary = new PaxDataSummary()
{
PassengerLocation = PaxPassengerLocation.Arrivals,
Destinations = await arrivalsDestinations,
Resorts = await arrivalsResorts,
Properties = await arrivalsProperties
};