Answered Json De-serialise different root objects

AussieBoy

Well-known member
Joined
Sep 7, 2020
Messages
78
Programming Experience
Beginner
Hi,
I have code that reads values via Json using Root and RootObject.
It works fine.

However, I now want to write to another system with in the same program, with different classes.
I have tried something like below. Which I get 'Object reference not set to an instance of an object.'.
I have checked the way I have set up my classes and they seem to be ok. May be I have not picked up on something.
Is what I am trying to do totally wrong, is there a better way? I have read a few posts on other sites, but don't get what they are suggesting at the moment.
Thanks,

Code:
QRootObject QRoot = JsonConvert.DeserializeObject<QRootObject>(response.Content); //Newtonsoft.Json.
 
I know, but I think I gave someone else a hard time last week for back editing an item after it had been public for a while. :)
 
It's Ok to edit your original code providing their are not any replies on it [QUOTED]. This exception does not apply on original and opening topics though.
 
Last edited:
I know, but I think I gave someone else a hard time last week for back editing an item after it had been public for a while. :)
I think that would be Ok here since you notified the change in post 29.
 
Back
Top Bottom