PostSharp 6.9 / / Post­Sharp Documentation / API Reference / Post­Sharp.​Aspects Namespace / IAspect­Provider Interface / IAspect­Provider Methods / IAspect­Provider.​Provide­Aspects Method

IAspectProvider.ProvideAspects Method

Provides new aspects.

Namespace:  PostSharp.Aspects
Assembly:  PostSharp (in PostSharp.dll) Version: (
IEnumerable<AspectInstance> ProvideAspects(
	Object targetElement


Type: System.Object
Code element (Assembly, Type, FieldInfo, MethodBase, PropertyInfo, EventInfo, ParameterInfo, or LocationInfo) to which the current aspect has been applied.

Return Value

Type: IEnumerable<AspectInstance>
A set of aspect instances.

Implementations of this method are only allowed to return aspect instances applied on elements of code located under the target element of code (targetElement). For instance, a type-level IAspectProvider can provide aspects on methods of the current type, but not of other types.

See Also