Ejemplo n.º 1
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);
        }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> GetCities(string country)
        {
            ListOfCitiesViewModel listOfCities = await Execute(() => _skyscannerService.Location.GetListOfCities(country));

            return(Ok(listOfCities));
        }