title: Get child properties from JSON using Json.NET and C#
body: <p>I have read a lot forums and still can't seem to piece this together. I am using Json.Net to parse a JSON file. It is extremely large and I just want one piece of it. I make the call and parse it like this:</p>
  
  <pre><code>string json = string.Empty;
  HttpWebResponse response; 
  string url = @""; 
  HttpWebRequest request = (HttpWebRequest)(WebRequest.Create(url)); 
  
  using (response = (HttpWebResponse)request.GetResponse()) 
  using (Stream stream = response.GetResponseStream())
  using (StreamReader reader = new StreamReader(stream))
  {
          json = reader.ReadToEnd();
  }
  
  JObject obj = JObject.Parse(json);
  </code></pre>
  
  <p>Like I said this JSON is huge but it is just a very long list of contacts. Here's what a single contact contains:</p>
  
  <pre><code>{
  "contacts": [
      {
          "addedAt": 1234,
          "vid": 1234,
          "canonical-vid": 1234,
          "merged-vids": [
              1234,
              1234
          ],
          "portal-id": 1234,
          "is-contact": true,
          "profile-token": "": "",
          "properties": {
              "country": {
                  "value": "united states"
              },
              "firstname": {
                  "value": "Example"
              },
              "jobtitle": {
                  "value": "Developer"
              },
              "primary_role": {
                  "value": "Developer"
              },
              "lastmodifieddate": {
                  "value": "1234"
              },
              "state": {
                  "value": "CO"
              },
              "email": {
                  "value": "example@notreal.com"
              },
              "lastname": {
                  "value": "Example"
              }
          },
          "form-submissions": [
              {
                  "conversion-id": "1234",
                  "timestamp": 1234,
                  "form-id": "",
                  "portal-id": 1234,
                  "page-url": "",
                  "page-title": "",
                  "title": "",
                  "form-type": "",
                  "meta-data": []
              }
          ],
          "identity-profiles": [
              {
                  "vid": 1234,
                  "saved-at-timestamp": 1234,
                  "deleted-changed-timestamp": 234,
                  "identities": [
                      {
                          "type": "EMAIL",
                          "value": "example@notreal.com",
                          "timestamp": 1243,
                          "is-primary": true
                      },
                      {
                          "type": "TYPE",
                          "value": "",
                          "timestamp": 1234
                      },
                      {
                          "type": "EMAIL",
                          "value": "example@notreal.com",
                          "timestamp": 1234,
                          "is-secondary": true
                      }
                  ]
              },
              {
                  "vid": 1234,
                  "saved-at-timestamp": 1324,
                  "deleted-changed-timestamp": 0,
                  "identities": [
                      {
                          "type": "TYPE",
                          "value": "",
                          "timestamp": 1234
                      }
                  ]
              }
          ],
          "merge-audits": [
              {
                  "canonical-vid": 1234,
                  "vid-to-merge": 1234,
                  "timestamp": 1324,
                  "entity-id": "",
                  "user-id": 1234,
                  "num-properties-moved": 234,
                  "merged_from_email": {
                      "value": "notreal@example.com",
                      "source-type": "CONTACTS",
                      "source-id": "SOURCE",
                      "source-label": null,
                      "source-vids": [
                          1234
                      ],
                      "timestamp": 1234,
                      "selected": false
                  },
                  "merged_to_email": {
                      "value": "example@notreal.com",
                      "source-type": "TYPE",
                      "source-id": "",
                      "source-label": null,
                      "timestamp": 1234,
                      "selected": false
                  },
                  "first-name": "Example",
                  "last-name": "Example"
              }
          ]
      }
  ],
  "has-more": true,
  "vid-offset": 1234
  }
  </code></pre>
  
  <p>I don't care about any of the information on here except what is under "properties". Everything in property I need to store in a dictionary so for example &lt;"Country", "United States">. This code below gives me the entire "properties" chuck:</p>
  
  <pre><code>foreach(var item in contacts.Children())
          {
              var itemProps = item.Children&lt;JProperty&gt;();
              var myElement = itemProps.FirstOrDefault(x =&gt; x.Name == "properties");
              var myElementValue = myElement.Value;
          }
  </code></pre>
  
  <p>I;m struggling with how to narrow this down even further and get a dictionary or something filled with the key values that are within properties? Any help would be much appreciated.</p>