Open sandboxFocus

Method AddRules

AddRules<T>(IEligibilityBuilder<T>, Action<IEligibilityBuilder<T>>)

Adds rules to the given IEligibilityBuilder by invoking an action that operates directly on the builder.

Declaration
public static void AddRules<T>(this IEligibilityBuilder<T> eligibilityBuilder, Action<IEligibilityBuilder<T>> requirement) where T : class
Parameters
Type Name Description
IEligibilityBuilder<T> eligibilityBuilder

The parent eligibility builder.

Action<IEligibilityBuilder<T>> requirement

An action that adds one or more eligibility rules to the builder.

Type Parameters
Name Description
T

The type of declaration being validated.

Remarks

This is a helper method that allows grouping multiple eligibility rules within an action delegate. It's functionally equivalent to calling the action directly on the builder, but can improve code organization.