Newtonsoft - how to reliably parse JObject
Giving out some code reliably flatten Newtonsoft JObjet into custom object call JsonNodeValue.
There are 2 main method exposed
- FlattenJsonObject - which is to flatten jobject.
- LookForJsonKey - allow you to search though Json property path / object structure, like
e,g. data.result which basically means root->data->result of your json object.
To use it, you can potentially just do something like so,
var srcObject = objectJson.FlattenJsonObject();
srcObject.LookForJsonKey
Comments