MetalamaAPI documentationAspect APIMetalama.​Framework.​EligibilityEligibility­ExtensionsIs­Aspect­Eligible
Open sandboxFocus

EligibilityExtensions.IsAspectEligible Method

IsAspectEligible<T>(IDeclaration, EligibleScenarios)

Determines whether the given declaration is an eligible target for a specified aspect type given as a type parameter.

Declaration
public static bool IsAspectEligible<T>(this IDeclaration declaration, EligibleScenarios scenarios)
where T : IAspect
Parameters
Type Name Description
IDeclaration declaration

The declaration for which eligibility is determined.

EligibleScenarios scenarios

The scenarios for which eligibility is determined. The default value is Default.

Returns
Type Description
System.Boolean

true if declaration is eligible for the aspect type T for any of the specified scenarios.

Type Parameters
Name Description
T

The aspect type.

IsAspectEligible(IDeclaration, Type, EligibleScenarios)

Determines whether the given declaration is an eligible target for a specified aspect type given as a reflection Type(IEligibilityBuilder<IHasType>).

Declaration
public static bool IsAspectEligible(this IDeclaration declaration, Type aspectType, EligibleScenarios scenarios)
Parameters
Type Name Description
IDeclaration declaration

The declaration for which eligibility is determined.

System.Type aspectType

The aspect type.

EligibleScenarios scenarios

The scenarios for which eligibility is determined. The default value is Default.

Returns
Type Description
System.Boolean

true if declaration is eligible for the given aspectType for any of the specified scenarios.