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

DeclarationEnhancements<T>.GetAspectInstances Method

GetAspectInstances()

Gets the set of aspects (represented by their IAspectInstance) that have been applied to a specified declaration.

Declaration
public IEnumerable<IAspectInstance> GetAspectInstances()
Returns
Type Description
IEnumerable<IAspectInstance>

The set of aspects of exact type T applied on the current Metalama.Framework.Code.DeclarationEnhancements`1.Declaration.

Remarks

This method will only return 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.