public async Task<IDictionary<string, IEnumerable<TransportTime>>> MyTransportTimes() { var username = identity.GetUserName(); var client = new TransportTimesClient(); var result = new Dictionary<string, IEnumerable<TransportTime>>(); var myJourneys = dbContext.JourneysEager().Where(j => j.UserEmail == username); foreach (var journey in myJourneys) { IEnumerable<TransportTime> times = Array.Empty<TransportTime>(); foreach (var serviceFilter in journey.DepartureCriteriaCollection) { var station = serviceFilter.Station; switch (station.StationType) { case StationType.busStop: case StationType.luasStop: { var t = await client.GetTimesForBusStop(station.ID); times = times.Concat(ApplyServiceListFilter(serviceFilter, t)); break; } case StationType.trainStation: { var t = await client.GetTimesForDartStation(station.ID, serviceFilter.Station.Direction.Value); times = times.Concat(ApplyServiceListFilter(serviceFilter, t)); break; } } } result.Add( journey.Name, times.OrderBy(t => t.Minutes)); } return result; }