Skip to content

Provide IConfigurationSource based registration helpers for Autofac #83

@ghost

Description

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions