How to deserialize JSON in .NET Part 2 – Create the Class

Now it’s time to create the class that can represent the .JSON file which we can deserialize into.

public class WeatherForecast
    public DateTimeOffset Date { get; set; }
    public int TemperatureCelsius { get; set; }
    public string Summary { get; set; }
    public IList<DateTimeOffset> DatesAvailable { get; set; }
    public string[] SummaryWords { get; set; }

Great! Now in the next and final post we’ll deserialize the .json file.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: