Method HasAttribute
HasAttribute<T>(Type)
Determine if the type has an attribute.
Declaration
public static bool HasAttribute<T>(this Type type) where T : Attribute
Parameters
| Type | Name | Description |
|---|---|---|
| Type | type | The type. |
Returns
| Type | Description |
|---|---|
| bool |
Type Parameters
| Name | Description |
|---|---|
| T | The attribute type. |
HasAttribute<T>(Enum)
Determine if the enum value has an attribute.
Declaration
public static bool HasAttribute<T>(this Enum enumValue) where T : Attribute
Parameters
| Type | Name | Description |
|---|---|---|
| Enum | enumValue | The enum value. |
Returns
| Type | Description |
|---|---|
| bool |
Type Parameters
| Name | Description |
|---|---|
| T | The attribute type. |