ReflectionExtensions.GetCustomAttribute method

Version 1.1.28
.NET Framework 4.8
Namespace Skybrud.Essentials.Reflection.Extensions
Assembly Skybrud.Essentials.dll

GetCustomAttribute<T>(Enum)

Extension method

Returns the first attribute of type T, or null if no matching attributes are found.

public static T GetCustomAttribute<T>(this Enum value)

Type Parameters

T

The type of the attribute to return.

Parameters

value Enum

The enum value to get the attribute for.

Returns

T

An instance of T, or null if no matching attributes are found.

GetCustomAttribute<T>(MemberInfo)

Extension method

Returns the first attribute of type T, or null if no matching attributes are found.

public static T GetCustomAttribute<T>(this MemberInfo member)

Type Parameters

T

The type of the attribute to return.

Parameters

member MemberInfo

The member holding the attribute.

Returns

T

An instance of T, or null if no matching attributes are found.

GetCustomAttribute<T>(Type)

Extension method

Returns the first attribute of type T, or null if no matching attributes are found.

public static T GetCustomAttribute<T>(this Type type)

Type Parameters

T

The type of the attribute to return.

Parameters

type Type

The type holding the attribute.

Returns

T

An instance of T, or null if no matching attributes are found.