I’m trying to parse some JSON using the System.Runtime.Serialization.Json library. The documentation seems a little sparse and I’m confused as to how to accomplish what I need. Here is the format for the JSON I need to parse through.
{
"data": {
"translations": [
{
"translatedText": "ne",
"detectedSourceLanguage": "en"
}
]
}
}
Here is a set of classes that represent the JSON data structure you have. I have chosen names that will help you correlate the type with the location in the JSON string.
Now the following is an example of deserializing your JSON string into this structure.