jason file =
{
"educations": {
"count": 23,
"education": [{
"studId": "",
"joinDate": "2021-04-08 12:22",
"regDate": "2021-04-08 12:23",
"enrolled": false,
"eduId": "1-eassasa7",
"pId": "dfdgdfg456fghf",
"startDate": "2021-09-03",
"expiry": {
"monthlyExpire": true
},
"reRegistration": "OPTIONAL",
"refreeId1": "",
"refreeId2": "",
"tutor": true,
"libraryAllowed": true,
"sports": "ENABLE",
"sendNotification": true,
"ccEmail": "",
"isTest": false,
"SportsGroup"
above is my jason and I was able to get that in to the response
string rawResponse = apiDataResponse.Content;
var result = JsonConvert.DeserializeObject<RootData>(rawResponse);
below are my classes
RootData
{
[JsonProperty(PropertyName ="educations")]
public education[] edu1 { get; set; }
}
class educationss
{
public int count { get; set; }
[JsonProperty(PropertyName="education")]
public education[] edu { get; set; }
}
class education
{
public string studId { get; set; }
public DateTime joinDate { get; set; }
public DateTime regDate { get; set; }
public bool enrolled { get; set; }
public string eduId { get; set; }
public string pId { get; set; }
public DateTime startDate { get; set; }
public expiry[] monthlyExpire { get; set; }
public string reRegistration { get; set; }
public string refreeId1 { get; set; }
public string refreeId2 { get; set; }
public bool tutor { get; set; }
public bool LibraryAllowed { get; set; }
public string sports { get; set; }
public bool sendNotification { get; set; }
public string ccEmail { get; set; }
public bool isTest { get; set; }
public sportGroup[] sportGroup { get; set; }
}
But I am unable to get any value for my result variable and it shows null.
Can you please help me?
try this
classes
you have to fix your json