Open sandboxFocus

Method HasAspect

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
Type aspectType

The exact type of aspect to check for.

Returns
Type Description
bool

true if the declaration has at least one aspect of the specified type; otherwise, false.

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
bool

true if the declaration has at least one aspect of the specified type; otherwise, false.

Type Parameters
Name Description
TAspect

The exact type of aspect to check for.

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.