Open sandboxFocus

Method MustBeConvertibleTo

MustBeConvertibleTo(IEligibilityBuilder<IType>, Type, ConversionKind)

Requires the target type to be convertible to a given type (specified as a reflection Type).

Declaration
public static void MustBeConvertibleTo(this IEligibilityBuilder<IType> eligibilityBuilder, Type type, ConversionKind conversionKind = ConversionKind.Default)
Parameters
Type Name Description
IEligibilityBuilder<IType> eligibilityBuilder

The eligibility builder for a type.

Type type

The target type that the validated type must be convertible to.

ConversionKind conversionKind

The kind of conversion required (default, implicit, explicit, or reference). Default is Default.

MustBeConvertibleTo(IEligibilityBuilder<IType>, IType, ConversionKind)

Requires the target type to be convertible to a given type (specified as an IType).

Declaration
public static void MustBeConvertibleTo(this IEligibilityBuilder<IType> eligibilityBuilder, IType type, ConversionKind conversionKind = ConversionKind.Default)
Parameters
Type Name Description
IEligibilityBuilder<IType> eligibilityBuilder

The eligibility builder for a type.

IType type

The target type that the validated type must be convertible to.

ConversionKind conversionKind

The kind of conversion required (default, implicit, explicit, or reference). Default is Default.

MustBeConvertibleTo<T>(IEligibilityBuilder<IType>, ConversionKind)

Requires the target type to be convertible to a given type (specified as a type parameter).

Declaration
public static void MustBeConvertibleTo<T>(this IEligibilityBuilder<IType> eligibilityBuilder, ConversionKind conversionKind = ConversionKind.Default)
Parameters
Type Name Description
IEligibilityBuilder<IType> eligibilityBuilder

The eligibility builder for a type.

ConversionKind conversionKind

The kind of conversion required (default, implicit, explicit, or reference). Default is Default.

Type Parameters
Name Description
T

The target type that the validated type must be convertible to.