I am having trouble in deserializing the following JSON structure. Each node contains a ID and multiple language code with values. The number of language attributes is not consistent. But I need those values as a list of objects which has a Language field and a Value field.
[{
"id":"w_312457",
"eng":"deep-fat frying",
"ger":"Frittieren"
},
{
"id":"w_312458",
"fre":"frying",
"ger":"braten (in Öl)"
},
{
"id":"w_312477",
"ger":"perfekt gewürzte und abgestimmte Soße "
}]
I tried using JsonPropertyName
attribute and I got the ID value. But for lang nodes, I dont know what name I can specify. Following is my CLR object,
public class Word
{
public string Id { get; set; } // This is working
// What can I specify here. I need a list of objects each with a lang code and value.
}