public async Task Load() { IEnumerable <CoronavirusCountry> countries = await _coronavirusCountryService.GetTopCases(AMOUNT_OF_COUNTRIES); CoronavirusCountryCaseCounts = new ChartValues <int>(countries.Select(c => c.CaseCount)); CoronavirusCountryNames = countries.Select(c => c.CountryName).ToArray(); }
public async Task Load() { IEnumerable <CoronavirusCountry> countries = await _coronavirusCountryServices.GetTopCases(AMOUNT_OF_COUNTRY); CoronavirusCountryCaseCounts = new ChartValues <int>(countries.Select(c => c.CaseCount)); CoronavirusCountryNames = new ObservableCollection <string>(countries.Select(c => c.CountryName)); }
public async Task Load() { IEnumerable<CoronavirusCountry> countries = await _coronavirusCountryService.GetTopCases(AMOUNT_OF_COUNTRIES); CoronavirusCountryCaseCounts = new ChartValues<int>(countries.Select(c => c.CaseCount)); CoronavirusCountryNames.Clear(); foreach (string countryName in countries.Select(c => c.CountryName)) { CoronavirusCountryNames.Add(countryName); } }
public IActionResult Index() { return(View(_coronavirusCountryService.GetTopCases(10).Result.ToList())); }
private async Task Load() { _coronaData = await _coronavirusCountryService.GetTopCases(AMOUNT_OF_CASES); }