Open sandboxFocus

Method To

To<TOutput>()

Converts to an IEligibilityBuilder<T> for a more specific type and adds an eligibility requirement that the declaration must be of the specified type.

Declaration
public IEligibilityBuilder<TOutput> To<TOutput>() where TOutput : class, T
Returns
Type Description
IEligibilityBuilder<TOutput>

An eligibility builder for TOutput.

Type Parameters
Name Description
TOutput

The more specific type to convert to (must be derived from or the same as T).

Remarks

If the validated object is not of type TOutput, the declaration becomes ineligible. Use this when you want to ensure the declaration is of a specific type and add additional rules for that type.

For conditional rules that only apply when the declaration happens to be of a certain type (without making it ineligible if it's not), use When<TOutput>() instead.

See Also
When<TOutput>()