title: Custom Configuration Binder for Property
body: <p>I'm using Configuration Binding in an ASP.NET Core 1.1 solution. Basically, I have some simple code for the binding in my ConfigureServices Startup section that looks like this:</p>
  
  <pre><code>services.AddSingleton(Configuration.GetSection("SettingsSection").Get&lt;SettingsClass&gt;());
  </code></pre>
  
  <p>The wrinkle is that my class as an int property that is normally bound to an int value in the configuration file, but could be bound instead to the string "disabled". Under the hood, I want the property to get a value of -1 if it is bound to the string "disabled".</p>
  
  <p>It can be more complicated than this, but I'm simplifying for the sake of brevity.</p>
  
  <p>My question is this: How do I provide a custom binder/converter for that overrides the configuration binding for a specific property in SettingsClass so that when doing a string conversion it will convert "disabled" to -1, rather than throwing an exception that "disabled" can't be converted to an Int32?</p>