-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
Hi everyone,
it would be cool if you could add support for the Options Pattern.
If there is at least one class that uses the attribute, the generated method should be: serviceCollection.AutoRegister(IConfiguration configuration);
An attribute might look like this:
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
public class OptionAttribute : Attribute {
public string? Section {get;}
public OptionAttribute(string? section = null) {
Section = section;
}
}Possible Usages:
[Option]
public record RootOption {}
[Option("SectionOption")]
public record SectionOption {}
[Option("SectionOption:InnerSection:MoreInnerSection")]
public record InnerSectionOption {}Thank you
Metadata
Metadata
Assignees
Labels
No labels