public CurrentWeatherModel(string json) : base(json) { var jObject = JObject.Parse(json); City = (string)jObject["name"]; var sys = jObject["sys"]; Country = (string)sys["country"]; var temperature = jObject["main"]; MinimalTemperature = WeatherExtentions.GetCelsium((double)temperature["temp_min"]); MaximalTemperature = WeatherExtentions.GetCelsium((double)temperature["temp_max"]); }
public WeatherInformation(string json) { var jObject = JObject.Parse(json); var weather = jObject["weather"]; WeatherIcon = (string)weather[0]["icon"]; WeatherStatus = (string)weather[0]["main"]; var wind = jObject["wind"]; WindSpeed = (int)wind["speed"]; var temperature = jObject["main"]; Temperature = WeatherExtentions.GetCelsium((double)temperature["temp"]); }