JSON.net, C#, unable to set default values in data model
I am using JsonConvert.DeserializeObject(json.ToString()); to deserialise a JSON and populate my fields in a related model. This works well until there is data missing in the JSON. Basically instead of having "key : value" I will just have "key : null". My understanding about the JsonConverter was that it would create an object, in which I should be able to populate fields with a default value either through the constructor (not being called in my case for unknown reasons), or through the tags as mentioned here: Default value for missing properties with JSON.net or here: Why when I deserialize