title: How to conditionally deserialize a json based on the property value
body: <p>I have a json incoming and I want to deserialize to the Class only if a property value is matching a specific string.
  eg:
  My json is :</p>
  <pre><code>[
  {
  &quot;string1&quot;: &quot;a&quot;;
  &quot;string2&quot;: &quot;b&quot;;
  &quot;string3&quot;: &quot;c&quot;;
  isActive: true
  },
  {
  &quot;string1&quot;: &quot;d&quot;;
  &quot;string2&quot;: &quot;e&quot;;
  &quot;string3&quot;: &quot;f&quot;;
  isActive: false
  }
  ]
  </code></pre>
  <p>My Class is:</p>
  <pre><code>public class InboundJson
  {
      public string string1 { get; set; }
      public string string2 { get; set; }
      public string string3 { get; set; }
      public bool isActive { get; set; }
  }
  
  InboundJson jsonobj = JsonConvert.DeserializeObject&lt;InboundJson&gt;(result);
  </code></pre>
  <p>This works fine and converts the incoming json to object of InboundJson class.</p>
  <p>As you can see I have a json array with two parts. I need to deserialize in to the class only if isActive == false.</p>
  <p>Any idea how this is possible?(other than manipulating the incoming json string)</p>