I am trying to deserialize JSON into a custom object, but all my properties are null and not sure what is going on. Does anyone see something wrong?
JSON example
{ "Keys": [ { "RegistrationKey": "asdfasdfa", "ValidationStatus": "Valid", "ValidationDescription": null, "Properties": [ { "Key": "Guid", "Value": "i0asd23165323sdfs68661358" } ] } ] }
Here is my code where strResponseValid is the JSON above.
Keys myDeserializedObjValid = (Keys)JsonConvert.DeserializeObject(strResponseValid, typeof(Keys)); validationStatusValid = myDeserializedObjValid.ValidationStatus;
Here are my classes
public class Keys { public string RegistrationKey { get; set; } public string ValidationStatus { get; set; } public string ValidationDescription { get; set; } public List<Properties> PropertiesList { get; set; } } public class Properties { public string Key { get; set; } public string Value { get; set; } }
source share