I'm calling an API to fetch a list of devices. In my model i have an attribute for list of devices:
public List<Device> device { get; set; }
But, if the API returns 1 device, it's returned as just a Device, not a list of devices with 1 device.
Is there any good way to have a dynamic deserialize? I don't want to have two different models, and parse the JSON programatically just to know which object to deserialize as.
JsonConvert.DeserializeObject<ListDevicesByLabelModel>(responseText);