I am trying to map the json response.
I have below json reponse code
string JSON = await SendGraphRequest("/users/", $"$filter=signInNames/any(x:x/value eq '{username}')", null, HttpMethod.Get); this the json response
{ "extension_7182f7a071344106a9e47cc960ab93e8_DOB": null, "extension_7182f7a071344106a9e47cc960ab93e8_middleName": null, "objectID": "", "accountEnabled": true, "email": Test } I want to deSerialize the json response, by using below code
var graphUserRespModel = JsonConvert.DeserializeObject<ResponseModelPrime>(JSON); I am using the three classes for DeserializeObject But i am getting the null value on all the fields. please let me know what mistake my doing.
public class ResponseModelPrime { [JsonProperty(PropertyName = "odata.metadata")] public string OdataMetadata { get; set; } [JsonProperty(PropertyName = "Status")] public StatusModel Status { get; set; } [JsonProperty(PropertyName = "objectId")] public string ObjectId { get; set; } [JsonProperty(PropertyName = "email")] public string Email { get; set; } [JsonProperty(PropertyName = "accountEnabled")] public bool AccountEnabled { get; set; } [JsonProperty(PropertyName = "DOB")] public string DOB { get; set; } [JsonProperty(PropertyName = "middleName")] public string middleName { get; set; } } public class ResponseModel { [JsonProperty(PropertyName = "objectId")] public string ObjectId { get; set; } [JsonProperty(PropertyName = "email")] public string Email { get; set; } [JsonProperty(PropertyName = "accountEnabled")] public bool AccountEnabled { get; set; } } public class ResponseModelSIT : ResponseModel { [JsonProperty(PropertyName = "extension_7182f7a071344106a9e47cc960ab93e8_DOB")] public string extension_7182f7a071344106a9e47cc960ab93e8_DOB { get; set; } [JsonProperty(PropertyName = "extension_7182f7a071344106a9e47cc960ab93e8_middleName")] public string extension_7182f7a071344106a9e47cc960ab93e8_middleName { get; set; } } 