Class ConfigAttribute
- Namespace
- AetherUtils.Core.Attributes
- Assembly
- AetherUtils.Core.dll
Specifies the name of a property in a YAML configuration file, an optional comment description, and an optional default value to apply.
[Config("connectionString", "The connection string used for connecting to a database.", "host=;port=;user=;password=;database=;")]
public string ConnectionString { get; set; } = string.Empty;
The name of the property as it will appear in the YAML file.
A description of the property that will appear as a comment above the property in YAML.
The default value that should be applied to the property in the YAML file.
public string ConnectionString { get; set; } = string.Empty;
[AttributeUsage(AttributeTargets.Property)]
public sealed class ConfigAttribute : Attribute
- Inheritance
-
ConfigAttribute
- Inherited Members
- Extension Methods
Constructors
ConfigAttribute(string, string?, object?)
Specifies the name of a property in a YAML configuration file, an optional comment description, and an optional default value to apply.
[Config("connectionString", "The connection string used for connecting to a database.", "host=;port=;user=;password=;database=;")]
public string ConnectionString { get; set; } = string.Empty;
The name of the property as it will appear in the YAML file.
A description of the property that will appear as a comment above the property in YAML.
The default value that should be applied to the property in the YAML file.
public string ConnectionString { get; set; } = string.Empty;
public ConfigAttribute(string name, string? description = null, object? defaultValue = null)
Parameters
Properties
DefaultValue
An optional default value for this configuration option. Defaults to
null if not specified.public object? DefaultValue { get; }
Property Value
Description
An optional description that will be written as a comment above the config name in the YAML file.
public string? Description { get; }
Property Value
Name
The YAML name of the property in the configuration file.
public string Name { get; }