Attribute reference

The Energy.Attribute namespace provides metadata attributes for code organization, command-line parsing, data binding, and documentation.

Application attributes

Located in Energy.Attribute.Application.

Attribute Purpose
ModuleAttribute Marks a module.
PluginAttribute Marks a plugin.
ExtensionAttribute Marks an extension.
LibraryAttribute Marks a library.

Command-line attributes

Located in Energy.Attribute.Command.

Attribute Purpose
OptionAttribute Marks a command-line option.
ArgumentAttribute Marks a command-line argument.
WelcomeAttribute Provides welcome text.
public class Options
{
    [Energy.Attribute.Command.Option("input", Short = "i")]
    public string Input;

    [Energy.Attribute.Command.Option("output", Short = "o")]
    public string Output;
}

Data attributes

Located in Energy.Attribute.Data.

Attribute Purpose
ColumnAttribute Maps a property to a column.
TableAttribute Maps a class to a table.
ElementAttribute Maps to an XML element.
LengthAttribute Specifies length.
TypeAttribute Specifies data type.
PrimaryAttribute Marks a primary key.
IncrementAttribute Marks an auto-increment column.
LabelAttribute Display label.
DescriptionAttribute Description.
AttributeAttribute Maps to an XML attribute.
AbstractAttribute Marks an abstract mapping.
ModelAttribute Marks a model class.
NullAttribute Null handling.

Code organization attributes

Located in Energy.Attribute.Code.

Attribute Purpose
TemporaryAttribute Temporary code.
MisplacedAttribute Misplaced code.
ObsoleteAttribute Obsolete code.
FutureAttribute Future implementation.
BadAttribute Known bad code.
VerifyAttribute Needs verification.
ExtendAttribute Needs extension.
WrapperAttribute Wrapper code.
DuplicationAttribute Duplicated code.
AttentionAttribute Needs attention.
BenchmarkAttribute Benchmark candidate.
SafetyAttribute Safety concern.
OriginAttribute Origin note.
RenameAttribute Planned rename.
DraftAttribute Draft code.
ImplementAttribute Needs implementation.
AbandonedAttribute Abandoned code.
ImproveAttribute Needs improvement.
NotWorkingAttribute Not working.
WorkInProgressAttribute Work in progress.

Other attributes

Attribute Purpose
TextAttribute (Markdown) Markdown documentation marker.
DictionaryAttribute (Value) Key/value marker.

See also

  • core-configuration for attribute-driven configuration.