Esempio n. 1
0
 private string GetWeatherDataByCityNameUrl(string appId, string cityName, string countryCode, WeatherUnits units)
 {
     if (!string.IsNullOrEmpty(countryCode))
     {
         return($"http://api.openweathermap.org/data/2.5/weather?q={cityName},{countryCode}&appid={appId}&units={units.ToString()}");
     }
     else
     {
         return(GetWeatherDataByCityNameUrl(appId, cityName, units));
     }
 }
Esempio n. 2
0
 private string GetWeatherDataByCityIdUrl(string appId, int cityId, WeatherUnits units)
 {
     return($"http://api.openweathermap.org/data/2.5/weather?Id={cityId}&appid={appId}&units={units.ToString()}");
 }
Esempio n. 3
0
 private string GetWeatherDataByZipUrl(string appId, string zipCode, string countryCode, WeatherUnits units)
 {
     return($"http://api.openweathermap.org/data/2.5/weather?zip={zipCode},{countryCode}&appid={appId}&units={units.ToString()}");
 }