Metalama 1.0 / / Metalama Documentation / Aspect API Documentation / Metalama.​Framework.​Validation / IValidator­Receiver­Selector<TTarget> / With

Method With

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

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

Declaration
IValidatorReceiver<TMember> With<TMember>(Func<TTarget, IEnumerable<TMember>> selector)
where TMember : class, IDeclaration
Parameters
Type Name Description
Func<TTarget, IEnumerable<TMember>> selector
Returns
Type Description
IValidatorReceiver<TMember>
Type Parameters
Name Description
TMember

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

Declaration
IValidatorReceiver<TMember> With<TMember>(Func<TTarget, TMember> selector)
where TMember : class, IDeclaration
Parameters
Type Name Description
Func<TTarget, TMember> selector
Returns
Type Description
IValidatorReceiver<TMember>
Type Parameters
Name Description
TMember