MetalamaAPI documentationAspect APIMetalama.​Framework.​AspectsOverride­Method­Aspect
Open sandboxFocus

OverrideMethodAspect Class

A base aspect that overrides the implementation of a method.

Inheritance
OverrideMethodAspect
Namespace: Metalama.Framework.Aspects
Assembly: Metalama.Framework.dll
Syntax
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>)
OverrideAsyncEnumerableMethod()
OverrideAsyncEnumeratorMethod()
OverrideAsyncMethod()
OverrideEnumerableMethod()
OverrideEnumeratorMethod()
OverrideMethod()

Default template of the new method implementation.

See Also