Hi,
i have variable Json and want to deserialize with Newtonsoft.Json.
This type of Json will not be able to be transformed to a c# class. What to do?
Thanks in advance.
The "variableKeyxxx123" - keys can occur several times with random names.
In some times, there are "morevalues".
{
"result":
{
"computers": {
"variableKeyxxx123":
{
"id": 3333,
"name": "name1",
"xvalues": "xxValues"
},
"variableKeyxxx862":
{
"id": 4444,
"name": "name2",
"xvalues": "xxValues"
},
"variableKeyxxx442":
{
"id": 55555,
"name": "name3",
"xvalues": "xxValues",
"morevalues": {
"valuexy": "hello"
}
}
}
}
}
What I have tried:
Tried jsonToC# and Newtonsoft.Json but creating class from the Response above will cause Errors because the Computers are named as in Response.
public class Computers
{
public VariableKeyxxx123 variableKeyxxx123 { get; set; }
public VariableKeyxxx862 variableKeyxxx862 { get; set; }
public VariableKeyxxx442 variableKeyxxx442 { get; set; }
}