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 ( 2 and 3 below)

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:

  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; }}    

This can be done with jobs in the JSON.net library.

  var transaction = job Purse (jason) Property value (). Selection (o = & gt; ooobject & lt; transaction & gt; ());   

This should do the trick.

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -