示例#1
0
        public async Task <string> GetConditionsForLocationAtTimeAsync(WeatherLocation loc, DateTime value)
        {
            var forecast = new ForecastIOPortable.ForecastApi("8703082d49387d351564670982b3bc7c");
            var weather  = await forecast.GetWeatherDataAsync(loc.Latitude, loc.Longitude);

            //weather.Daily.Days.Where(d => d.)

            throw new NotImplementedException();
        }
示例#2
0
        public async Task <string> GetCurrentConditionsAsync(WeatherLocation city)
        {
            var forecast = new ForecastIOPortable.ForecastApi("8703082d49387d351564670982b3bc7c");
            var weather  = await forecast.GetWeatherDataAsync(city.Latitude, city.Longitude);

            var currentTemp       = weather.Currently.ApparentTemperature;
            var currentConditions = weather.Currently.Summary;

            return($"Right now in {city.LocationName} it's {currentConditions} with a temperature of {currentTemp}");
        }