PostSharp 6.5 / / Post­Sharp Documentation / API Reference / Post­Sharp.​Aspects Namespace / IAspect­Repository­Service Interface / IAspect­Repository­Service Methods / IAspect­Repository­Service.​Has­Aspect Method

IAspectRepositoryService.HasAspect Method

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

Namespace:  PostSharp.Aspects
Assembly:  PostSharp (in PostSharp.dll) Version: 6.5.19.0 (6.5.19.0)
Syntax
C#
bool HasAspect(
	Object declaration,
	Type aspectType
)

Parameters

declaration
Type: System.Object
The declaration on which the presence of the aspect must be checked.
aspectType
Type: System.Type
The type of aspect.

Return Value

Type: Boolean
true if an aspect of type aspectType has been applied to declaration, otherwise false.
See Also