-
Notifications
You must be signed in to change notification settings - Fork 8
Section names
edpollitt edited this page Dec 3, 2015
·
2 revisions
AutoConfig will try to match the requested type to a config section using convention-based name resolution.
E.g.
| type name(s) | can be mapped from section name(s) |
|---|---|
| Foo, IFoo | foo |
| FooConfiguration, IFooConfiguration | foo, fooConfiguration |
| FooConfig, IFooConfig | foo, fooConfig |
By default, camelCasing is used, though this can be overridden if required.
The Map method optionally takes an explicit section name. This is useful when mapping multiple instances of the same configuration class.
var primary = AutoConfig.Map<IMyServiceConguration>("primaryService");
var secondary = AutoConfig.Map<IMyServiceConguration>("secondaryService");