Class ConfigurationAttribute
Mark field/property as a configuration entry
[AttributeUsage(AttributeTargets.Property|AttributeTargets.Field, AllowMultiple = false, Inherited = false)]
public class ConfigurationAttribute : Attribute
- Inheritance
-
objectAttributeConfigurationAttribute
Constructors
ConfigurationAttribute()
public ConfigurationAttribute()
ConfigurationAttribute(string)
public ConfigurationAttribute(string SectionName)
Parameters
SectionName
string
ConfigurationAttribute(string, bool)
public ConfigurationAttribute(string SectionName, bool RegisterInServices)
Parameters
ConfigurationAttribute(string, bool, bool)
public ConfigurationAttribute(string SectionName, bool RegisterInServices, bool IsSensitive)
Parameters
Fields
AllowNull
By default, the service host will instantiate a configuration value if is null. Set true to allow null values to pass through
public bool AllowNull
Field Value
IsSensitive
Indicates whether this is a sensitive information (eg. a password). In that case the config will be hidden in the Blaze config editor
public bool IsSensitive
Field Value
RegisterInServices
Register configuration in services using services.Configure{T}(), so it can be resolved using IOptions{T}
public bool RegisterInServices
Field Value
SectionName
The Section name that will be used to resolve the config from the Configuration System. (eg. appsettings.json)
public string? SectionName