Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Looks like you can't turn this into a class because <code>02</code> is not a valid property name.</p> <p>You can try using <code>JObject</code> that comes with <a href="http://james.newtonking.com/pages/json-net.aspx" rel="nofollow">Json.Net</a>. It acts much like a <code>Dictionary</code>:</p> <p>Here's a sample:</p> <pre><code>[Test] public void Parse() { const string src = @"{ ""productNum"":6, ""01"": {""US_7"":""pna886377847444"",""US_7_5"":""pna886377847529"",""US_8"":""pna886377847604"",""US_8_5"":""pna886377847666"",""US_9"":""pna886377847741"",""US_9_5"":""p na886377847826"",""US_10"":""pna886377847895"",""US_10_5"":""pna886377847987"",""US_11"":""pna886377848069"",""US_11_5"":""pna886377848144"",""US_12"":""pna88637784 8229"",""US_13"":""pna886377848328"",""US_14"":""pna886377848427""}, ""02"": {""US_7"":""pna886377849103"",""US_7_5"":""pna886377849202"",""US_8"":""pna886377849295"",""US_8_5"":""pna886377849394"",""US_9"":""pna886377849493"",""US_9_5"":""p na886377849592"",""US_10"":""pna886377849660"",""US_10_5"":""pna886377849745"",""US_11"":""pna886377849820"",""US_11_5"":""pna886377849905"",""US_12"":""pna88637784 9981"",""US_13"":""pna886377850086"",""US_14"":""pna886377850185""} }"; // filtering out the "productNum:6" var dest = JsonConvert.DeserializeObject&lt;IDictionary&lt;string, object&gt;&gt;(src) .Where(x =&gt; x.Value.GetType() == typeof (JObject)); foreach (var item in dest) { var obj = (JObject) item.Value; Console.WriteLine(item.Key); foreach (var d in obj) { Console.WriteLine("{0}: {1}", d.Key, d.Value); } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload