title: NullValueHandling.Ignore influences deserialization into [ExtensionData] despite matching class member
body: <p>My server responses consists of a set of known and unknown properties. For the known ones, I created a DTO class with members for each property. The unknown properties shall be put inside a dictionary annotated with the <code>[ExtensionData]</code> attribute:</p>
  
  <pre><code>[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
  public class Dto
  {
  
      [JsonExtensionData]
      private readonly Dictionary&lt;string, object&gt; unknownProperties = new Dictionary&lt;string, object&gt;();
  
      public IDictionary&lt;string, object&gt; UnknownProperties
      {
          get
          {
              return new ReadOnlyDictionary&lt;string, object&gt;(this.unknownProperties);
          }
      }
  
      [JsonProperty(Required = Required.Default, PropertyName = "KNOWN_PROPERTY")]
      public string KnownProperty { get; private set; }
  }
  </code></pre>
  
  <p><code>Null</code> is allowed as value for <code>KnownProperty</code>. If I try to deserialize a JSON object that contains <code>KNOWN_PROPERTY : null</code>, this property is also contained in the dictionary <code>UnknownProperties</code>, if I configure the serializer with <code>NullValueHandling.Ignore</code>. This is done even though a class member exists for <code>KNOWN_PROPERTY</code>:</p>
  
  <pre><code>static void Main(string[] args)
  {
     string jsonString = @"{
            KNOWN_PROPERTY : null,
            UNKNOWN_PROPERTY : null
     }";
  
     JsonSerializer serializer = JsonSerializer.CreateDefault(new JsonSerializerSettings()
     {
         NullValueHandling = NullValueHandling.Ignore
      });
  
      using (var textReader = new StringReader(jsonString))
      {
         Dto dto = serializer.Deserialize&lt;Dto&gt;(new JsonTextReader(textReader));
         foreach (var pair in dto.UnknownProperties)
         {
             Console.WriteLine("{0}: {1}", pair.Key, pair.Value == null ? "null" : pair.Value.ToString());
          }
      }
   }
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code> KNOWN_PROPERTY : null
   UNKNOWN_PROPERTY : null
  </code></pre>
  
  <p>If I configure the serializer with <code>NullValueHandling.Include</code> or set a value for <code>KNOWN_PROPERTY</code> in the JSON string, the dictionary contains only <code>UNKNOWN_PROPERTY</code>, as expected.</p>
  
  <p>For my understanding <code>[ExtensionData]</code> is not working correctly if <code>NullValueHandling</code> is set to ignore, since the <a href="http://www.newtonsoft.com/json/help/html/T_Newtonsoft_Json_JsonExtensionDataAttribute.htm" rel="nofollow">documentation</a> states the extension is used only if no matching class member is found. </p>
  
  <p>Is the behavior I'm seeing intended? Can I do something to avoid this? Because I don't like to send null values to the server, I'd like to stick to the currently set <code>NullValueHandling</code>.</p>
  
  <p>I'm using Json.NET 8.0.2</p>