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,
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.