Table of Contents

Class EnumValueAttribute

Namespace
Trellis
Assembly
Trellis.Primitives.dll

Specifies the canonical symbolic value for a RequiredEnum<TSelf> member.

[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = false)]
public sealed class EnumValueAttribute : Attribute
Inheritance
EnumValueAttribute
Inherited Members
Extension Methods

Remarks

Apply this attribute to a public static readonly field on a RequiredEnum<TSelf> type only when the external symbolic name must differ from the default CLR field name.

If the attribute is not present, RequiredEnum<TSelf> falls back to the field name.

Constructors

EnumValueAttribute(string)

Initializes a new instance of the EnumValueAttribute class.

public EnumValueAttribute(string value)

Parameters

value string

The external symbolic value to use instead of the field name.

Exceptions

ArgumentException

Thrown when value is null, empty, or whitespace.

Properties

Value

Gets the canonical symbolic value for the annotated enum member.

public string Value { get; }

Property Value

string