Skip to content

OptionaryAttribute<T>

Classsealednet10.0
📦 Optionary v0.1.2-beta.10
Declares the configuration section of an options type T from the assembly, for types you don't own.
namespace Optionary;
public sealed class OptionaryAttribute<T>
: System.Attribute
where T : class
{
// ...
}
T: class
Attribute
T
The options type.

For example, [assembly: Optionary<HostOptions>("Hosting")].

The section path follows the same rules as OptionaryAttribute. Apply it once for each type you configure. A type has one section: naming it twice, or also declaring it with the class form, is reported as OPT0010. OptionaryAttribute`1.KeyStyle works as it does on the class form.

Only works with source generators enabled.

View all constructors
View all properties