Beispiel #1
0
        private async void DataUpdateAsync(object state)
        {
            var weatherTowns = _weatherStorage.GetAll();

            foreach (var weatherTown in weatherTowns)
            {
                var weather = await _httpClient.GetAsync(weatherTown.Name);

                weatherTown.Temp = weather.Temp;

                _weatherStorage.Update(weatherTown);
            }
        }
 public Task <City> GetCityForecastAsync(int id)
 {
     return(_httpClient.GetAsync <City>($"{_config.OpenWeatherUrl}?id={id}&appid={_config.OpenWeatherKey}"));
 }
Beispiel #3
0
 private async Task <WeatherTown> GetWeather(TownRequest town)
 {
     return(await _weatherHttpClient.GetAsync(town.Name));
 }