title: Setting a boolean property from a 3rd party endpoint that returns a string
body: <p>I am attempting to deserialize a json object using JsonConvert - the data is coming from a 3rd party API</p>
  <pre><code>return JsonConvert.DeserializeObject&lt;UserRegistration&gt;(content,
                      JsonSnakeCaseNameStrategySettings.Settings());
  </code></pre>
  <p>The UserRegistration class:</p>
  <pre><code>public class UserRegistration
      {
          public UserRegistrationData UserRegistration { get; set; }
      }
  
      public class UserRegistrationData
      {
          public int UserId { get; set; }
  
          public string Email { get; set; }
  
          public UserRegistrationCustomFields CustomFields { get; set; }
      }
  
      public class UserRegistrationCustomFields
      {
          private bool emailDelivery;
          public string DeliveryTime { get; set; }
  
          public bool EmailDelivery {
              get
              {
                  return emailDelivery;
              }
              set
              {
                  emailDelivery = value.ToString() == &quot;1&quot;;
              }
          }
  
          public bool SmsDelivery { get; set; }
  
          public string PhoneNumber { get; set; }
      }
  </code></pre>
  <p>I've tried several ways, this is my current iteration.  The goal is to have &quot;EmailDelivery&quot; be a boolean, the value from the API will always be &quot;1&quot; or &quot;0&quot;.  This throws a JsonReaderException: <code>Could not convert string to boolean: 0. Path 'user_registration.custom_fields.email_delivery', line 1, position 208.</code></p>