.net - How to deserialize json to multiple types dynamically in c# -


this question has answer here:

i have json string below :

{ "error" : "xxxx" , "data" : int type or {...other complex json object} }

i don't know when return int or other json string data field , , how deserialize ?

when type of data object or dynamic , real deserialized type of data int or dictionary using javascriptserializer.deserialize(string json).

the real deserialized type of data int64 or jcontainer when using json.net.

is there elegance way solve ? don't think reflection way.

you can create object-wrapper , put data type identificator first field of wrapper.


Comments

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

Pull out data related to my apps from Android Play Store and iOS App Store -

How can I fetch data from a web server in an android application? -