-Added Populate and IgnoreAndPopulate options to DefaultValueHandling for automatically populating default values during deserialization

This commit is contained in:
JamesNK
2011-08-01 02:05:14 +00:00
parent ce2b5e02e0
commit bc726f1b6d
9 changed files with 123 additions and 24 deletions
@@ -37,6 +37,14 @@ namespace Newtonsoft.Json.Tests.TestObjects
[DefaultValue("Default!")]
public string DefaultValueHandlingIncludeProperty { get; set; }
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)]
[DefaultValue("Default!")]
public string DefaultValueHandlingPopulateProperty { get; set; }
[JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
[DefaultValue("Default!")]
public string DefaultValueHandlingIgnoreAndPopulateProperty { get; set; }
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public string NullValueHandlingIgnoreProperty { get; set; }