This repository was archived by the owner on Dec 18, 2018. It is now read-only.

Description
After PR #282 is pushed we will have the ability to bind the values of configuration sections to scalars and also entire configuration sections to structural objects, e.g.:
var timeout = config.Get<int>("timeout");
I have been looking at how this API could be used and I think a lot of friction would go away if we accepting inline default values, e.g.:
var timeout = config.Get<int>("timeout", defaultValue: 30);
// or even simpler, inferring the type from the default value:
var timeout = config.Get("timeout", defaultValue: 30);
Design & implementation notes:
- This default values can work with structural objects as well: an instance with default property values is passed and any properties with matching configuration values are overwritten. Do we still need the public
Bind() method after this?
- The private
BindInstance() method already returns the passed instance if no value could be read or no properties could be set. Seems that we can leverage that behavior.