title: Deserialize json data into list in c#
body: <p>I am calling an external web service and this is what I get in response after posting to their server:</p>
  
  <pre class="lang-js prettyprint-override"><code>{
     "status":200,
     "data":{
        "h21":{
           "total_price":{
              "acacia":{
                 "available":0,
                 "price":null,
                 "availability":false
              },
              "maple":{
                 "available":7,
                 "price":2399.0,
                 "availability":true
              }
           }
        },
        "h17":{
           "total_price":{
              "mahogany":{
                 "available":1,
                 "price":1899.0,
                 "availability":true
              },
              "oak":{
                 "available":0,
                 "price":null,
                 "availability":false
              },
              "maple":{
                 "available":6,
                 "price":1649.0,
                 "availability":true
              }
           }
        }
     }
  }
  </code></pre>
  
  <p>I want this response to be converted into a list. I used jsontocsharp online converter to generate class and use code below:</p>
  
  <pre><code>var Jsonresult = JsonConvert.DeserializeObject&lt;Sstageback.Models.Sstage.treeboRoomTypes.RootObject&gt;(JsonReplace);
  </code></pre>
  
  <p>But the thing is mine is a dynamic JSON response which can change over course of time.</p>
  
  <p>Note: The response which I get from the server is hotel and its room availability so while generating classes I can't generate with a single class file since the hotel id's may change also the room types and its availability also changes.</p>
  
  <p>Example: h21 is one hotel id and total_price has its room type details similarly h17 is the next hotel and total_price has its room type details.</p>