title: How would I Deserialize grouped JSON data with C#
body: <p>I have been struggling to deserialize this JSON string and I thought someone could help me.</p>
  <p>This is the json;</p>
  <pre><code>{
    &quot;22/7/2020&quot;: {
      &quot;0&quot;: {
        &quot;date&quot;: null,
        &quot;time&quot;: &quot;9:00 pm&quot;,
        &quot;place&quot;: &quot;London&quot;,
        &quot;name&quot;: &quot;Date night&quot;
      },
      &quot;1&quot;: {
        &quot;date&quot;: null,
        &quot;time&quot;: &quot;2:30 pm&quot;,
        &quot;place&quot;: &quot;London&quot;,
        &quot;name&quot;: &quot;Lunch&quot;
      }
    },
    &quot;23/7/2020&quot;: {
      &quot;0&quot;: {
        &quot;date&quot;: null,
        &quot;time&quot;: &quot;1:00 pm&quot;,
        &quot;place&quot;: &quot;Cafe&quot;,
        &quot;name&quot;: &quot;Coffee Meeting&quot;
      }
    },
    &quot;24/7/2020&quot;: {
      &quot;0&quot;: {
        &quot;date&quot;: null,
        &quot;time&quot;: &quot;3:00 pm&quot;,
        &quot;place&quot;: &quot;London&quot;,
        &quot;name&quot;: &quot;Run&quot;
      },
      &quot;27/7/2020&quot;: {
        &quot;0&quot;: {
          &quot;date&quot;: null,
          &quot;time&quot;: &quot;6:00 pm&quot;,
          &quot;place&quot;: &quot;Mountains&quot;,
          &quot;name&quot;: &quot;Hiking&quot;
        }
      },
      &quot;30/7/2020&quot;: {
        &quot;0&quot;: {
          &quot;date&quot;: null,
          &quot;time&quot;: &quot;10:00 am&quot;,
          &quot;place&quot;: &quot;Solo Cafe&quot;,
          &quot;name&quot;: &quot;Brunch&quot;
        }
      },
      &quot;3/8/2020&quot;: {
        &quot;0&quot;: {
          &quot;date&quot;: null,
          &quot;time&quot;: &quot;8:00 pm&quot;,
          &quot;place&quot;: &quot;London&quot;,
          &quot;name&quot;: &quot;Drinks&quot;
        },
        &quot;1&quot;: {
          &quot;date&quot;: null,
          &quot;time&quot;: &quot;11:00 am&quot;,
          &quot;place&quot;: &quot;Work&quot;,
          &quot;name&quot;: &quot;Work&quot;
        },
        &quot;2&quot;: {
          &quot;date&quot;: null,
          &quot;time&quot;: &quot;6:00 pm&quot;,
          &quot;place&quot;: &quot;Grandma's&quot;,
          &quot;name&quot;: &quot;Dinner with Grandma&quot;
        }
      }
    }
  }
  </code></pre>
  <p>As you can see the objects are grouped under the date element which creates this kind of nested structure and my problem is I don't know how to deserialize this into an object list. I tried doing it this way:</p>
  <p>Using these two classes;</p>
  <pre><code>public class events_final
  {
      [DataMember]
      public string Date { get; set; }
  
      [DataMember]
      public List&lt;details&gt; Event_Details { get; set; }
  }
  public class details
  {
      [DataMember]
      public string date { get; set; }
  
      [DataMember]
      public string time { get; set; }
  
      [DataMember]
      public string place { get; set; }
  
      [DataMember]
      public string name { get; set; }
  }
  </code></pre>
  <p>And doing this:</p>
  <pre><code>var Deserialized_Json = JsonConvert.DeserializeObject&lt;List&lt;details&gt;&gt;(json_string);
  </code></pre>
  <p>However, that didn't work and instead, I got all these errors:</p>
  <pre><code>at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject (Newtonsoft.Json.JsonReader reader, System.Type objectType, Newtonsoft.Json.Serialization.JsonContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, Newtonsoft.Json.Serialization.JsonProperty containerMember, System.Object existingValue) [0x003a0] in &lt;2073514815234917a5e8f91b0b239405&gt;:0 
    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal (Newtonsoft.Json.JsonReader reader, System.Type objectType, Newtonsoft.Json.Serialization.JsonContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, Newtonsoft.Json.Serialization.JsonProperty containerMember, System.Object existingValue) [0x0006d] in &lt;2073514815234917a5e8f91b0b239405&gt;:0 
    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType, System.Boolean checkAdditionalContent) [0x000db] in &lt;2073514815234917a5e8f91b0b239405&gt;:0 
    at Newtonsoft.Json.JsonSerializer.DeserializeInternal (Newtonsoft.Json.JsonReader reader, System.Type objectType) [0x00054] in &lt;2073514815234917a5e8f91b0b239405&gt;:0 
    at Newtonsoft.Json.JsonSerializer.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType) [0x00000] in &lt;2073514815234917a5e8f91b0b239405&gt;:0 
    at Newtonsoft.Json.JsonConvert.DeserializeObject (System.String value, System.Type type, Newtonsoft.Json.JsonSerializerSettings settings) [0x0002d] in &lt;2073514815234917a5e8f91b0b239405&gt;:0 
    at Newtonsoft.Json.JsonConvert.DeserializeObject[T] (System.String value, Newtonsoft.Json.JsonSerializerSettings settings) [0x00000] in &lt;2073514815234917a5e8f91b0b239405&gt;:0 
    at Newtonsoft.Json.JsonConvert.DeserializeObject[T] (System.String value) [0x00000] in &lt;2073514815234917a5e8f91b0b239405&gt;:0
  </code></pre>
  <p>I would really appreciate it if someone could help me deserialize this into a list!</p>