MetalamaAPI documentationPost­Sharp API migrationPost­Sharp.​ReflectionReflection­SearchGet­Custom­Attributes­On­Target
Open sandboxFocus

ReflectionSearch.GetCustomAttributesOnTarget Method

GetCustomAttributesOnTarget(Object)

In Metalama, use IDeclaration.Attributes.

Declaration
public static CustomAttributeInstance[] GetCustomAttributesOnTarget(object target)
Parameters
Type Name Description
System.Object target
Returns
Type Description
CustomAttributeInstance[]

GetCustomAttributesOnTarget(Object, ReflectionSearchOptions)

In Metalama, use IDeclaration.Attributes.

Declaration
public static CustomAttributeInstance[] GetCustomAttributesOnTarget(object target, ReflectionSearchOptions options)
Parameters
Type Name Description
System.Object target
ReflectionSearchOptions options
Returns
Type Description
CustomAttributeInstance[]

GetCustomAttributesOnTarget<T>(Object, ReflectionSearchOptions)

In Metalama, use IDeclaration.Attributes.

Declaration
public static IList<T> GetCustomAttributesOnTarget<T>(object target, ReflectionSearchOptions options)
where T : Attribute
Parameters
Type Name Description
System.Object target
ReflectionSearchOptions options
Returns
Type Description
System.Collections.Generic.IList<T>
Type Parameters
Name Description
T