private Location[] GetLocations(Leg leg, Dictionary <int, string> placesNames) { return(new[] { leg.OriginStation, leg.DestinationStation }.Select(loc => placesNames[loc]) .Select(loc => loc.Split(' ').First()) .Select(loc => locationHandler.GetLocationByName(loc)).ToArray()); }
private Money GetMoney(Leg leg, Dictionary <string, decimal> prices, SkyscannerResponse response) { return(new Money(Currencies.GetCurrency((string)response.Query["Currency"]), prices[leg.Id])); }
private DateTime[] GetDates(Leg leg) { return(new[] { leg.Departure, leg.Arrival }.Select(DateTime.Parse).ToArray()); }