Exemple #1
0
        private Weather ConvertForecastModel(Dailyforecast input)
        {
            DateTime date = DateTimeOffset.FromUnixTimeSeconds(input.EpochDate).LocalDateTime;

            return(new Weather()
            {
                Humidity = 0,
                TemperatureCurrent = 0,
                TemperatureMax = Math.Round(input.Temperature.Maximum.Value),
                TemperatureMin = Math.Round(input.Temperature.Minimum.Value),
                WindSpeed = 0,
                WeatherDescription = "",
                Icon = $"accuweather{input.Day.Icon}.png",
                Date = date
            });
        }
 private double GetDailyAverage(Dailyforecast dailyforecast)
 {
     return((dailyforecast.Temperature.Minimum.Value + dailyforecast.Temperature.Maximum.Value) / 2);
 }