MetalamaAPI documentationAspect APIMetalama.​Framework.​CodeDeclaration­Enhancements<T>Has­Aspect
Open sandboxFocus

DeclarationEnhancements<T>.HasAspect Method

HasAspect(Type)

Determines if the current declaration has at least one aspect of the given type.

Declaration
public bool HasAspect(Type aspectType)
Parameters
Type Name Description
System.Type aspectType
Returns
Type Description
System.Boolean
Remarks

You can call this method only for aspects that have been already been applied or are being applied, i.e. you can query aspects that are applied before the current aspect, or you can query instances of the current aspects applied in a parent class.

HasAspect<TAspect>()

Determines if the current declaration has at least one aspect of the given type.

Declaration
public bool HasAspect<TAspect>()
where TAspect : IAspect<T>
Returns
Type Description
System.Boolean
Type Parameters
Name Description
TAspect
Remarks

You can call this method only for aspects that have been already been applied or are being applied, i.e. you can query aspects that are applied before the current aspect, or you can query instances of the current aspects applied in a parent class.