MetalamaAPI documentationAspect APIMetalama.​Framework.​EligibilityEligibility­ExtensionsMust­Satisfy
Open sandboxFocus

EligibilityExtensions.MustSatisfy Method

MustSatisfy<T>(IEligibilityBuilder<T>, Predicate<T>, Func<IDescribedObject<T>, FormattableString>)

Adds a condition to the given IEligibilityBuilder, where the condition must be satisfied by the declaration in order to be eligible for the aspect. The new rule is given as a System.Predicate<>.

public static void MustSatisfy<T>(this IEligibilityBuilder<T> eligibilityBuilder, Predicate<T> predicate, Func<IDescribedObject<T>, FormattableString> getJustification)
where T : class
Type Name Description
IEligibilityBuilder<T> eligibilityBuilder

The parent IEligibilityBuilder.

System.Predicate<T> predicate

A predicate that returns true if the declaration is eligible for the aspect.

System.Func<IDescribedObject<T>, System.FormattableString> getJustification

A delegate called in case predicate returns false and when the justification of the non-ineligibility is required. This delegate must return a System.FormattableString, i.e. a C# interpolated string ($"like {this}").

Type Parameters
Name Description