Open sandboxFocus

Struct EligibilityExtensions.Converter<T>

A helper type that allows to convert an IEligibilityBuilder<T> for a type to an IEligibilityBuilder<T> of another type.

Namespace: Metalama.Framework.Eligibility
Assembly: Metalama.Framework.dll
Syntax
public readonly struct EligibilityExtensions.Converter<T> where T : class
Type Parameters
Name Description
T

Methods

Name Description
To<TOutput>()

Gets an IEligibilityBuilder<T> for another type. Adds an eligibility rule that the validated object must be of the specified type. If the validated object is not of the specified type, the parent eligibility rule fails.

When<TOutput>()

Gets an IEligibilityBuilder for another type, but only adds the rule when the validated object is of the given type. If the validated object is not of the specified type, the child eligibility rule is ignored. Uses If<T>(IEligibilityBuilder<T>, Predicate<T>).