title: How to apply ObjectCreationHandling.Replace to selected properties when deserializing JSON?
body: <p>I have a class that contains a <code>List&lt;Tuple&lt;int, int, int&gt;&gt;</code> property whose default constructor allocates the list and fills it with some default values, for instance:</p>
  
  <pre><code>public class Configuration
  {
      public List&lt;Tuple&lt;int, int, int&gt;&gt; MyThreeTuple { get; set; }
  
      public Configuration()
      {
          MyThreeTuple = new List&lt;Tuple&lt;int, int, int&gt;&gt;();
          MyThreeTuple.Add(new Tuple&lt;int, int, int&gt;(-100, 20, 501));
          MyThreeTuple.Add(new Tuple&lt;int, int, int&gt;(100, 20, 864));
          MyThreeTuple.Add(new Tuple&lt;int, int, int&gt;(500, 20, 1286));
      }
  }
  </code></pre>
  
  <p>When I deserialize an instance of this class from JSON using Json.NET, the values from JSON get <em>added</em> to the list rather than <em>replacing</em> the items in the list, causing the list to have too many values.  A solution to this problem is given in <a href="https://stackoverflow.com/a/25555839/2985796">Json.Net calls property getter during deserialization of list, resulting in duplicate items</a>.</p>
  
  <pre><code>var settings = new JsonSerializerSettings { ObjectCreationHandling = ObjectCreationHandling.Replace };
  var config = JsonConvert.DeserializeObject&lt;Configuration&gt;(jsonString, settings);    
  </code></pre>
  
  <p>This causes Json.NET to allocate fresh instances everything being deserialized.</p>
  
  <p>However, this introduces an additional problem: my class exists in a larger object graph, and some of the types in the graph do not have default constructors.  They are instead constructed by a constructor in the containing class.  If I use <code>ObjectCreationHandling = ObjectCreationHandling.Replace</code>, Json.NET fails trying to construct instances of these types with the following exception:</p>
  
  <pre><code>Unable to find a constructor to use for the type MySpecialType. A class 
  should either have a default constructor, one constructor with arguments
  or a constructor marked with the JsonConstructor attribute. 
  </code></pre>
  
  <p>How can I apply <code>ObjectCreationHandling.Replace</code> selectively to certain properties in my object graph, and not others?</p>