title: Newtonsoft - deserialize “1” as conditional bool property
body: <p>I have the following JSON object:</p>
  
  <pre><code>  {
      "entity": "Customer",
      "id": "XXX",
      "isActive": "1",
      "createdTime": "2018-01-30T18:56:51+02:00",
      "updatedTime": "2019-01-05T02:15:17+02:00",
  </code></pre>
  
  <p>and the following DTO class:</p>
  
  <pre><code>public class Customer
  {
      public string Id { get; set; }
      public bool IsActive { get; set; }
      public DateTime CreatedTime { get; set; }
      public DateTime UpdatedTime { get; set; }
  }
  </code></pre>
  
  <p>and code for deserialization:</p>
  
  <pre><code>        var jsonResponse = JObject.Parse(customerString);
          JToken array = jsonResponse["response_data"];
          List&lt;Customer&gt; result = (List&lt;Customer&gt;)array.ToObject(typeof(List&lt;Customer&gt;));
  </code></pre>
  
  <p>but I have a problem with <code>IsActive</code> property, because json object has 1 or 0 values, but I want to have boolean. How to write JsonSerializer to do it?</p>