0

How to convert all elements as key value pair in json. EX :

{
    "Id": " 357342524563456678",
    "title": "Person",
    "language": "eng",
    "questionAnswer": [
        {
            "4534538254745646.1": {
                "firstName": "Janet",
                "questionNumber": "1.1"
            }
        }
    ]
}

For this i need key value pair for id,title,language including firstname and questionnumber.

foreach (KeyValuePair<string, JToken> sourceProperty in Response)
            {}

This code giving id,titile,language,questionanswer as key value pair, but firstname and questionnumber also required as key value pair for some compariosn. Thanks in Advance.

Karthikeyan
  • 173
  • 4
  • 18
  • when you deserialise a json you gave a object you can loop through its propreties by `using obj.GetType().GetProperties()`. Is that enought ? – Drag and Drop Nov 20 '17 at 13:17
  • and as bonus : https://stackoverflow.com/questions/42770923/how-do-i-convert-json-string-to-key-value-pairs – Drag and Drop Nov 20 '17 at 13:18

0 Answers0