sia-digital / pibox

PiBox is a service hosting framework that allows .net devs to decorate their services with behaviours or functionality (think of plugins) while only using minimal configuration.
https://sia-digital.gitbook.io/pibox/
MIT License
6 stars 3 forks source link

Configuration attribute does not automatically register nested classes #38

Open fb-smit opened 8 months ago

fb-smit commented 8 months ago

Consider the following case

[Configuration("persistence")]
public class PersistenceConfiguration
{
    public SqlServerConfiguration SqlServer { get; set; }
    public SmbConfiguration Smb { get; set; }
}

Current Behaviour The webhost currently only auto registers the PeristenceConfiguration with the IoC Container bc it has the attribute, the nested config classes will not be registed automatically.

Expected Behaviour Nested configuration classes are also automatically registered as singleton in the IoC Container.

lukas-kd commented 8 months ago

Proposal: Allow specifing a node in the Configuriation-Attribute like "persistence.sqlServer", and add the attribute on the SqlServerConfiguration.