public async Task <CountryViewModel[]> GetCountriesAsync() { using (var context = new CountriesContext()) { var countries = await countriesRepository.GetAllCountriesAsync(context).ConfigureAwait(false); var countriesViewModels = new List <CountryViewModel>(); foreach (var country in countries) { countriesViewModels.Add(MapCountryToViewModel(country)); } return(countriesViewModels.ToArray()); } }
public async Task <IEnumerable <WeatherCityDAL.Models.CountryModel> > Get() { var countryList = await _countriesRepository.GetAllCountriesAsync(); return(countryList); }
public async Task <List <Countries> > GetAllCountriesAsync() { return(await _countriesRepository.GetAllCountriesAsync()); }