Trying to get the value of a Json but keep throwing me this error.
This is the code:
string djson = JsonConvert.SerializeObject(e);
var httpContent = new StringContent(djson, Encoding.UTF8, "application/json");
var response = await client.PostAsync(Baseurl + "ex.api/api/exmaple/indi/getindicertification", httpContent);
var jsonString = await response.Content.ReadAsStringAsync();
var messageResponse = JsonConvert.DeserializeObject<Messages>(jsonString);
var responseData = JsonConvert.DeserializeObject<ResultingRequest>(jsonString);
I also try this way too but keep trowing me a error too:
var responseData = JsonConvert.DeserializeObject<List<ResultingRequest>>(jsonString);
My model class looks like this:
public class ResultingRequest : EvaluationResult
{
public int Id { get; set; }
public int UserId { get; set; }
public DateTime RequestDate { get; set; }
public int CertificationRequestStatus { get; set; }
public int Language { get; set; }
public string OGPCorrelationID { get; set; }
public DateTime EmissionDate { get; set; }
public object Reason { get; set; }
public object Owner { get; set; }
public string OGPATGNumber { get; set; }
public object SolicitantName { get; set; }
public object SolicitantIDNumber { get; set; }
public DateTime ExpirationDate { get; set; }
public bool CommitedToPRACSES { get; set; }
public object Resolution { get; set; }
public object Kiosco { get; set; }
public object Comments { get; set; }
public bool PorAcuerdo { get; set; }
public int KioscoId { get; set; }
public string EvaluationResult { get; set; }
}
And this is the Json:
{
"ResultingRequest": {
"Id": 123 ,
"UserId": 3456 ,
"RequestDate": "09-20-2019",
"CertificationRequestStatus": 4,
"Language": 1,
"OGPCorrelationID": "",
"EmissionDate": "",
"Reason": null,
"Owner": null,
"OGPATGNumber": "",
"SolicitantName": null,
"SolicitantIDNumber": null,
"ExpirationDate": "",
"CommitedToPRACSES": false,
"Resolution": null,
"Kiosco": null,
"Comments": null,
"PorAcuerdo": false,
"KioscoId": 1,
"EvaluationResult": "Negative"
},
"EvaluationResult": {
"SolicitantIsMinor": false,
"EvaluationResults": [],
"IndividualHasNoCases": true,
"IndividualDeceased": false,
"CertificationType": "Negative",
"RestrictedIndividual": false
},
"CertificationPDFBytes": "",
"SentByEmail": true,
"SentByEmailSuccess": true,
"Message": null,
"CertificationKey": ""
}
I want to get the value "EvaluationResult" from the ResultingRequest:{}. What do I do wrong or what I'm missing? I try a couple of ways I search for this but all the ways I keep receiving an error.
