Open sandboxFocus

Method CreateRule

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

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

Declaration
public static IEligibilityRule<T> CreateRule<T>(Action<IEligibilityBuilder<T>> predicate, params Action<IEligibilityBuilder<T>>[]? otherPredicates) where T : class
Parameters
Type Name Description
Action<IEligibilityBuilder<T>> predicate
Action<IEligibilityBuilder<T>>[] otherPredicates
Returns
Type Description
IEligibilityRule<T>
Type Parameters
Name Description
T
Remarks

Eligibility rules are heavy and expensive objects although their evaluation is fast and efficient. It is recommended to store rules in static fields of the aspect.

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

Declaration
public static IEligibilityRule<TGeneral> CreateRule<TGeneral, TRequired>(Action<IEligibilityBuilder<TRequired>> predicate, params Action<IEligibilityBuilder<TRequired>>[]? otherPredicates) where TGeneral : class where TRequired : class, TGeneral
Parameters
Type Name Description
Action<IEligibilityBuilder<TRequired>> predicate
Action<IEligibilityBuilder<TRequired>>[] otherPredicates
Returns
Type Description
IEligibilityRule<TGeneral>
Type Parameters
Name Description
TGeneral
TRequired