The first model we are going to add is ForecastItem, which represents a specific forecast for a point in time. We do this as follows:
- In the Weather project and in the Models folder, create a new class called ForecastItem.
- Add the following code:
using System;
using System.Collections.Generic;
namespace Weather.Models
{
public class ForecastItem
{
public DateTime DateTime { get; set; }
public string TimeAsString => DateTime.ToShortTimeString();
public double Temperature { get; set; }
public double WindSpeed { get; set; }
public string Description { get; set; }
public string Icon { get; set; }
}
}