Try deserialising as Root
rather than List<Root>
:
Root data = JsonSerializer.Deserialize<Root>(result);
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi,
I have the following in my class which gets the data from my database:
public object application { get; set; }
The problem is that sometimes it's null and therefore the app will fail to run.
How can I handle the null here?
I tried:
public object? application { get; set; }
but it's not valid
Thanks,
Try deserialising as Root
rather than List<Root>
:
Root data = JsonSerializer.Deserialize<Root>(result);