Does Newtonsoft.JSON library have a simple way I can automatically deserialize JSON into 2 different Models/classes?
For example I get the JSON:
[{
\"g
Not in one call, and it seems the data is an array, so you need a little more work.
Zip
is the key method here to join the two separate object lists:
Guardian[] guardians = JsonConvert.DeserializeObject(response.Content);
Patient[] patients = JsonConvert.DeserializeObject(response.Content);
var combined = guardians.Zip(patients, (g, p) => Tuple.Create(g, p)).ToList();
It would be far more easier to just read the JSON at once, it a single object.