Example #1
0
        public async Task <ListOfCitiesViewModel> GetListOfCities(string country, string languageId = "en-gb")
        {
            ListOfContinents listOfCotinents = await GetFullListOfContinents(languageId);

            List <City> cities = listOfCotinents.Continents.SelectMany(x => x.Countries).Where(x => x.Name.Equals(country)).SelectMany(x => x.Cities).ToList();

            ListOfCitiesViewModel listOfCitiesViewModel = _skyscannerMapper.MapListOfCitiesToListOfCitiesViewModel(cities);

            return(listOfCitiesViewModel);
        }
Example #2
0
        public async Task <ListOfCitiesViewModel> GetListOfCities(string country, string languageId = "en-gb")
        {
            ListOfContinents listOfCotinents = await FileHelper.GetDataAsync <ListOfContinents>(FileName.PARENT_FOLDER, FileName.LIST_CONTINENTS);

            List <City> cities = listOfCotinents.Continents.SelectMany(x => x.Countries).Where(x => x.Name.Equals(country)).SelectMany(x => x.Cities).ToList();

            ListOfCitiesViewModel listOfCitiesViewModel = _skyscannerMapper.MapListOfCitiesToListOfCitiesViewModel(cities);

            return(listOfCitiesViewModel);
        }