Open sandboxFocus

Class EligibilityRuleFactory

Factory methods for creating instances of the IEligibilityRule<T> interface, including predefined rules for standard advice kinds and methods for creating custom rules.

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

This class provides:

Use these methods when implementing BuildEligibility(IEligibilityBuilder<T>) manually or when you need to verify eligibility programmatically using VerifyEligibility(IEligibilityRule<TAspectTarget>).

Methods

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

Creates a custom instance of the IEligibilityRule<T> interface using a builder pattern.

CreateRule<TGeneral, TRequired>(Action<IEligibilityBuilder<TRequired>>, params Action<IEligibilityBuilder<TRequired>>[]?)

Creates a custom instance of the IEligibilityRule<T> interface that validates a general type but requires a more specific type for the rule definition.

GetAdviceEligibilityRule(AdviceKind)

Gets the default eligibility rules that apply to a specific advice kind.

GetContractAdviceEligibilityRule(ContractDirection)

Gets the default eligibility rules that apply to a contract advice for a specific contract direction.

See Also