Hey all I have a class
public class Data {
string key {get; set;}
string value {get; set;}
}
public class Employee {
string x {get; set;}
string y {get; set;}
Data Data {get; set;}
}
In Json response I get the below value in string
{
"Employee":{
"x": null,
"y": null,
"Data" : {
"key": 1,
"Value": "hello"
}
}
}
I want to deserialize this Json string into type Employee I used
JsonConvert.DeserializeObject<Employee>(jsonString);
but It only populate the parent object and nested object data is null, here are results
{
"Employee":{
"x": null,
"y": null,
"Data" :null
}
}
Does anyone have some good solution to get the nested object value in an efficient way.