0

I have some JSON like this

{
    Something {
        Another {
            Key: "Value"
        }
    }
}

I convert that to a dynamic object using Newtonsoft.Json. Let's say I want to Console.WriteLine the inner member of 'Something'. Meaning I want the value 'Another' written in the Console.

In another JSON file the child of 'Something' could be different, like 'AThird', then I want that name written.

I've tried alittle with some reflection, but can't seem to find the member name.

MazeezaM
  • 149
  • 1
  • 10
  • 3
    "I've tried alittle with some reflection" Show *what* you´ve tried. We don´t want to provide those solution you´ve allready tested and that doesn´t work for you. – MakePeaceGreatAgain Nov 22 '17 at 13:52
  • `foreach (var property in (IDictionary)yourobject.Something) { Console.WriteLine(property.Key); }` – ADyson Nov 22 '17 at 14:03

0 Answers0