Open sandboxFocus

Method ReturnType

ReturnType(IEligibilityBuilder<IMethod>)

Gets an IEligibilityBuilder for the return type of the method validated by the given IEligibilityBuilder.

Declaration
public static IEligibilityBuilder<IType> ReturnType(this IEligibilityBuilder<IMethod> eligibilityBuilder)
Parameters
Type Name Description
IEligibilityBuilder<IMethod> eligibilityBuilder

The eligibility builder for a method.

Returns
Type Description
IEligibilityBuilder<IType>

An eligibility builder for the return type of the method.

Remarks

Use this method to add requirements on the return type of a method. For example, you can require that the return type is not void, or that it implements a specific interface.

When validation fails on the return type, the error message will clearly indicate that it's the return type that doesn't meet the requirement.