title: Generically Flatten Json using c#
body: <p>I want to generically flatten some json so I can convert to a datatable and bind to a datagrid using c#</p>
  
  <p>What is the best way of doign it, bearing in mind I dont know how many levels I am going down?</p>
  
  <p>e.g. </p>
  
  <pre>
  {
    "appointmentid": 4,
    "policyid": 1,
    "guid": "00000000-0000-0000-0000-000000000000",
    "number": "1234567890",
    "ampm": "false",
    "date": "2015-09-08T00:00:00",
    "vehicle": {
      "id": 1,
      "guid": "00000000-0000-0000-0000-000000000000",
      "make": null,
      "model": null
    },
    "installer": {
      "installerid": "1",
      "name": "Installer 1",
      "contact": "qwerty",
      "qascore": "0",
      "address1": "qwerty",
      "address2": "qwerty",
      "address3": null,
      "address4": null,
      "city": "qwertyu",
      "county": "qwertyu",
      "postcode": "asdfghj",
      "country": "GB",
      "email": "asdfghj",
      "web": "asdfghjk",
      "archived": false
    },
    "installations": [
      {
        "installationid": 6,
        "installationstatus": {
          "installationstatusid": 4,
          "installationstatus": "FAIL"
        },
        "isactive": true
      },
      {
        "installationid": 7,
        "installationstatus": {
          "installationstatusid": 1,
          "installationstatus": "NEW"
        },
        "isactive": false
      }
    ],
    "archived": false
  }
  </pre>
  
  <p>i would like to extend this (I suppose I could iterate over the datatable on I had converted it) rather than installations.1.installationid, i would get installationid1. </p>
  
  <p>as I'm going to be displaying the resulting datatable in a grid I would like to keep the column names friendly.</p>