I'm sure this has been asked but I'm unable to find it maybe because I don't know what the terms of it would be. Let's say I have the following:
JSON
{
"Field1": 1234,
"Field2": 5678,
"MoreData": {
"Field3": 9012,
"Field4": 3456
},
"Field5": "Test"
}
Class
public class Sample()
{
public int Field1 { get; set; }
public int Field2 { get; set; }
public int Field3 { get; set; }
public int Field4 { get; set; }
public string Field5 { get; set; }
}
If I deserialize this Field1, Field2, and Field5 will be populated but is there a way to also get Field3 and Field4 populated in an easy way.
I don't want to have a public class MoreData for Field2 and Field3.
internal
class then ? :) – aybe