c# - How to parse JSON objects with numeric keys using JavaScriptSerializer -
I have an object that has been deserialized in C #. I'm thinking how I can parse it. I tried the following, but how can I get my class to recognize the key of each object ( The JSON string below basically represents 2 transactions. I would like to convert each transaction presentation into a transaction object and change it into an array of transaction object. {"Id": "2", "user_id": "59", "offer_id": "1234"}, "3": {"id": "3", "user_id": "59", "offer_id": "1234"}} Here are my classes: This can be done with jobs in the JSON.net library. This should do the trick. 2 and
3 below)
Transactions {// is always different from the "key" field here? } Public Sector Transactions {Public Entry ID {Receipt; Set; } Public int user_id {get; Set; } Public int offer_id {get; Set; }}
var transaction = job Purse (jason) Property value (). Selection (o = & gt; ooobject & lt; transaction & gt; ());
Comments
Post a Comment