KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I'm trying to deserialize JSON into a custom object but all my properties are set to null and not sure what's going on. Does anyone see anything 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; } }
Tags (comma-separated)
Save Edits
Cancel