Before we write the code to fetch data from the external weather service, we will create models in order to deserialize the results from the service. We will do this so that we have a common model that we can use to return data from the service.
The easiest way to generate models to use when we are deserializing results from the service is to make a call to the service either in the browser or with a tool (such as Postman) to see the structure of the JSON. We can either create classes manually or use a tool that can generate C# classes from the JSON. One tool that can be used is quicktype, which can be found at https://quicktype.io/.
If you generate them manually, make sure to set the namespace to Weather.Models.
As mentioned previously, you can also create these models manually. We will describe how to do this in the next section.