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); }
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); }