PostSharp.ILAPI ReferencePost­Sharp.​AspectsIAspect­Repository­ServiceHas­Aspect
Open sandboxFocus

IAspectRepositoryService.HasAspect Method

HasAspect(Object, Type)

Determines whether an aspect of a given type has been applied to a given declaration.

Declaration
bool HasAspect(object declaration, Type aspectType)
Parameters
Type Name Description
Object declaration

The declaration on which the presence of the aspect must be checked.

Type aspectType

The type of aspect.

Returns
Type Description
System.Boolean

true if an aspect of type aspectType has been applied to declaration, otherwise false.