Metalama 1.0 / / Metalama Documentation / Aspect API / Metalama.​Framework.​Aspects / IAspect­Receiver­Selector<TTarget>

Interface IAspectReceiverSelector<TTarget>

An interface that allows aspects and fabrics to register aspects and validators for current compilation version.

Namespace: Metalama.Framework.Aspects
Assembly: Metalama.Framework.dll
Syntax
public interface IAspectReceiverSelector<out TTarget> : IValidatorReceiverSelector<TTarget> where TTarget : class, IDeclaration
Type Parameters
Name Description
TTarget

Methods

Name Description
With<TMember>(Func<TTarget, TMember>)

Selects a member or the parent of the target declaration of the current aspect or fabric with the purpose of adding aspects, annotations or validators to them using e.g. AddAspectIfEligible<TAspect>(EligibleScenarios). Validate(ValidatorDelegate<DeclarationValidationContext>) or ValidateReferences(ValidatorDelegate<ReferenceValidationContext>, ReferenceKinds).

With<TMember>(Func<TTarget, IEnumerable<TMember>>)

Selects members of the target declaration of the current aspect or fabric with the purpose of adding aspects, annotations or validators to them using e.g. AddAspectIfEligible<TAspect>(EligibleScenarios), Validate(ValidatorDelegate<DeclarationValidationContext>) or ValidateReferences(ValidatorDelegate<ReferenceValidationContext>, ReferenceKinds).