I have a JSON file returned from a system that looks like this:
{
"value1": "Hello",
"value2": "World",
"result":
{
"stats":
{
"count":"1"
}
}
}
Getting to the values "Value1" and "Value2" is no issue. However, I cannot get to "count" - Does not appear to be in a good format.
This is my code:
class Program
{
static void Main(string[] args)
{
string json1 = File.ReadAllText("test.json");
var info = JsonSerializer.Deserialize<SnData>(json1);
WriteLine("Value1: {0} , Value2: {1}",info.value1,info.value2);
}
}
class SnData
{
public string value1 {get; set;}
public string value2 {get; set;}
}
How to get the value "count"?