I am getting below json for api.
{
"performances": [
{
"Employee1": {
"firstname": "xxx",
"value": 2678
},
"Employee2": {
"firstname": "yyy",
"value": 2676
},
"starttime": "2021-04-09T14:48:00Z",
"endtime": "2022-04-09T14:49:00Z"
},
{
"Employee1": {
"firstname": "xxx",
"value": 3354
},
"Employee2": {
"firstname": "yyy",
"value": 234
},
"Employee3": {
"firstname": "qqq",
"value": 2344
},
"starttime": "2022-04-09T14:49:00Z",
"endtime": "2023-04-09T14:50:00Z"
}
]
}
tried Creating Dictionary<string, employee>
. but starttime
and endtime
gives the problem.
Can someone help me to Deserializing in .Net core using c#
i tried creating below classes. nothing worked. I was getting null for all values
public class Variable
{
public string firstname{ get; set; }
public double value{ get; set; }
}
public class Custom
{
public List<Dictionary<string, Variable>> response { get; set; }
public string starttime { get; set; }
public string endtime { get; set; }
}
public class CustomerList
{
public List<Custom> performances { get; set; }
}