Deserialize JSON with json.NET into C# dynamic -


i have following problem: have json file looks this

{     "path": {         "firstpath": "/1/2/text()"     } } 

if parse json-file newtonsoft this

 dynamic dyn = jobject.parse(json); 

or this

dynamic dyn = jsonconvert.deserializeobject(json); 

i dynamic object needs used this

dyn.path.firstpath.value 

how can rid of value stuff? of objects in json end being string. don't want write ".value" @ end if not necessary.

i tested using newtonsoft 8.0.2 , works fine.

        dynamic dyn = jobject.parse(json);          string value = dyn.path.firstpath; 

value should equal /1/2/text().


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -