ObjectExtensionsGetAttributeFromT(Type, String) Method

Get attribute from a type.

Definition

Namespace: Aliquo.Core
Assembly: Aliquo.Core (in Aliquo.Core.dll) Version: 5.0.9179.22651
C#
public static T GetAttributeFrom<T>(
	this Type type,
	string propertyName
)
where T : Attribute

Parameters

type  Type
Type with the type of attribute.
propertyName  String
The name of the property.

Type Parameters

T
The type of attribute to retrieve.

Return Value

T
An attribute from a type if found; otherwise, .

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Type. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

See Also