@model WeatherSet @{ ViewData["Title"] = "Home Page"; }
@*
@Model.Location.Name, @Model.Location.Region
*@ Last updated on @Model.Current.LastUpdated
@Model.Current.ConditionName
@Model.Current.Temperature°F
@foreach (var forecast in Model.Forecast) { var displayHours = new Dictionary { [6] = "Morning", [12] = "Noon", [17] = "Evening", [22] = "Night" }; var hourForecasts = forecast.HourForecasts .Join(displayHours, f => f.Time.Value.Hour, d => d.Key, (f, d) => new { TimeOfDay = d.Value, Forecast = f }) .ToList();
@forecast.Summary.ConditionName
@forecast.Summary.HighTemp / @forecast.Summary.LowTemp
@foreach (var hourForecast in hourForecasts) {
@hourForecast.TimeOfDay
@hourForecast.Forecast.ConditionName / @hourForecast.Forecast.Temperature
} }