Metalama 1.0 / / Metalama Documentation / Aspect API / Metalama.​Framework.​Eligibility / Eligibility­Extensions.​Converter<T>

Class EligibilityExtensions.Converter<T>

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

Inheritance
EligibilityExtensions.Converter<T>
Namespace: Metalama.Framework.Eligibility
Assembly: Metalama.Framework.dll
Syntax
public sealed class Converter<T> : ValueType 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>).