C# Json Convert any dynamic object to key value pairs
问题 I am writing a tool that will take an inbound Json object, and convert it to key-value records (sometimes called flattening, maybe). The aim is to avoid the tool breaking if it gets a very large or very nested Json object, so I would like to avoid recursion. An example object might be like this (below), containing nested arrays, empty values, you name it, literally any legal json... { "firstName": "John", "lastName": "Smith", "isAlive": true, "age": 25, "address": { "streetAddress": "21 2nd