Metalama / / API Documentation / Aspect API / Metalama.​Framework.​Eligibility / Eligibility­Extensions / Must­Be­Of­Type

Method MustBeOfType

MustBeOfType<T>(IEligibilityBuilder<T>, Type)

Requires the validated object to be of a certain type. Note that this validates the object itself, not the declaration that it represents. For instance, if the object is an IParameter and the type parameter is set to string, this method will fail with an exception no conversion exists from IParameter to string.

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