Open sandboxFocus

Class OverrideMethodAspect

A base aspect that overrides the implementation of a method.

Namespace: Metalama.Framework.Aspects
Assembly: Metalama.Framework.dll
Syntax
[AttributeUsage(AttributeTargets.Method)]
public abstract class OverrideMethodAspect : MethodAspect, IAspect<IMethod>, IAspect, ICompileTimeSerializable, ITemplateProvider, IEligible<IMethod>

Constructors

Name Description
OverrideMethodAspect()

Properties

Name Description
UseAsyncTemplateForAnyAwaitable

Gets or sets a value indicating whether the OverrideEnumerableMethod(), OverrideEnumeratorMethod(), OverrideAsyncEnumerableMethod" or OverrideAsyncEnumeratorMethod" template must be applied to all methods returning a compatible return type, instead of only to methods using the yield statement.

UseEnumerableTemplateForAnyEnumerable

Gets or sets a value indicating whether the OverrideAsyncMethod() template must be applied to all methods returning an awaitable type (including IAsyncEnumerable and IAsyncEnumerator), instead of only to methods that have the async modifier.

Methods

Name Description
BuildAspect(IAspectBuilder<IMethod>)

Initializes the aspect. The implementation must add advice, child aspects and validators using the builder parameter.

BuildEligibility(IEligibilityBuilder<IMethod>)

Configures the eligibility of the aspect or attribute. Implementations are not allowed to reference non-static members. Implementations must call the implementation of the base class if it exists.

OverrideAsyncEnumerableMethod()
OverrideAsyncEnumeratorMethod()
OverrideAsyncMethod()
OverrideEnumerableMethod()
OverrideEnumeratorMethod()
OverrideMethod()

Default template of the new method implementation.

Extension Methods

See Also