MetalamaAPI documentationAspect APIMetalama.​Framework.​EligibilityEligibility­Rule­Factory
Open sandboxFocus

EligibilityRuleFactory Class

Creates instances of the IEligibilityRule<T> interface, which can then be used by the VerifyEligibility(IEligibilityRule<TAspectTarget>) method.

Inheritance
System.Object
EligibilityRuleFactory
Namespace: Metalama.Framework.Eligibility
Assembly: Metalama.Framework.dll
Syntax
[CompileTime]
public static class EligibilityRuleFactory : Object

Methods

Name Description
CreateRule<T>(Action<IEligibilityBuilder<T>>, Action<IEligibilityBuilder<T>>[])

Create an instance of the IEligibilityRule<T> interface, which can then be used by the VerifyEligibility(IEligibilityRule<TAspectTarget>) method.

CreateRule<TGeneral, TRequired>(Action<IEligibilityBuilder<TRequired>>, Action<IEligibilityBuilder<TRequired>>[])
GetAdviceEligibilityRule(AdviceKind)

Gets the default eligibility rules that apply to a specific advice. The rules returned by this method are those used by classes OverrideMethodAspect, OverrideFieldOrPropertyAspect and so on. If you implement the BuildEligibility(IEligibilityBuilder<T>) method manually, you can use this method to get the base rules, and add only rules that are specific to your aspect.

GetContractAdviceEligibilityRule(ContractDirection)

Gets the default eligibility rules that apply to a contract advice for a specific direction. The rules returned by this method are those used by the ContractAspect class. If you implement the BuildEligibility(IEligibilityBuilder<T>) method manually, you can use this method to get the base rules, and add only rules that are specific to your aspect.