Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration attribute does not automatically register nested classes #38

Open
fb-smit opened this issue Feb 8, 2024 · 1 comment
Open
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed PiBox.Hosting.Abstractions

Comments

@fb-smit
Copy link
Contributor

fb-smit commented Feb 8, 2024

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.

@fb-smit fb-smit added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed PiBox.Hosting.Abstractions labels Feb 8, 2024
@lukas-kd
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed PiBox.Hosting.Abstractions
Projects
None yet
Development

No branches or pull requests

2 participants