I have my JSON as
{{
  "attributes": {
    "type": "User",
    "url": "/services/data/v44.0/sobjects/User/0052F000002bO32QAE"
  },
  "Name": "demo Site Guest User",
  "UserType": "Guest",
  "Profile": {
    "attributes": {
      "type": "Profile",
      "url": "/services/data/v44.0/sobjects/Profile/00e2F000000DuoFQAS"
    },
    "Id": "00e2F000000DuoFQAS",
    "Name": "demo Profile"
  }
}}
{{
  "attributes": {
    "type": "User",
    "url": "/services/data/v44.0/sobjects/User/00541000006I1JyAAK"
  },
  "Name": "Scheduler Site Guest User",
  "UserType": "Guest",
  "Profile": {
    "attributes": {
      "type": "Profile",
      "url": "/services/data/v44.0/sobjects/Profile/00e41000000GhKdAAK"
    },
    "Id": "00e41000000GhKdAAK",
    "Name": "Scheduler Profile"
  }
}}
In the above JSON, I want to fetch parent elements 'Name' and 'UserType' and child elements'Id' and 'Name' and convert into datatable. These parent and child elements are anonymous so I can't create classes for those.
I got up to here
dynamic responseRecs = (responseDetails.records as IEnumerable<object>).Cast<object>().ToList();
which is giving me the response but not sure how to loop through the dynamic and get parent and child line items (ignoring the type and url) so that I can build a datatable.
Any help will be greatly appreciated. Thanks