I want to be able to register config sections using IConfigurationSource.GetSection instead of ConfigurationManager.GetSection, without having to write multi-line methods for section and element types. Using Autofac as an example, the following or similar should be possible:
var builder = new ContainerBuilder();
builder.RegisterConfigurationSource<MySettings>("settings").As<ISettings>();
IContainer container = builder.Build();
var settings = container.Resolve<ISettings>(); // pulls from app / web.config by default
I want to be able to register config sections using
IConfigurationSource.GetSectioninstead ofConfigurationManager.GetSection, without having to write multi-line methods for section and element types. Using Autofac as an example, the following or similar should be possible: