EnumExtensions.GetAttributeOfType<T>(Enum) Method

Definition

Gets an attribute on an enum field value.

public static T GetAttributeOfType<T> (this Enum enumValue) where T : Attribute;
static member GetAttributeOfType : Enum -> 'T (requires 'T :> Attribute)
<Extension()>
Public Function GetAttributeOfType(Of T As Attribute) (enumValue As Enum) As T

Type Parameters

T

The type of the attribute to retrieve.

Parameters

enumValue
Enum

The enum value.

Returns

T

The attribute of the specified type or null.

Applies to