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