Open sandboxFocus
  • TOC

Metalama Documentation

Getting started

Video tutorials

Conceptual documentation

Commented examples

API documentation

Aspect API

Metalama.​Framework.​Advising

Metalama.​Framework.​Aspects

Aspect2

Aspect­Order­Attribute2

Aspect­Order­Direction

Aspect­Predecessor

Aspect­Predecessor­Extensions

Aspect­Predecessor­Kind

Aspect­Receiver­Extensions

Compilation­Aspect3

Compiled­Template­Attribute2

Compile­Time­Attribute3

Constructor­Aspect3

Contract­Aspect3

Contract­Direction

Declarative­Advice­Attribute2

Editor­Experience­Attribute2

Editor­Experience­Options

Event­Aspect3

Exclude­Aspect­Attribute2

Field­Aspect3

Field­Or­Property­Aspect3

Forced­Generic­Run­Time­Or­Compile­Time­Attribute3

Framework­Diagnostic­Descriptors

IAspect

IAspect<T>

IAspect­Builder

IAspect­Builder<TAspect­Target>

IAspect­Class

IAspect­Instance

IAspect­Predecessor

IAspect­Receiver<TDeclaration>

IAspect­Receiver<TDeclaration, TTag>

IAspect­State

IConditionally­Inheritable­Aspect

IMeta­Target

Inheritable­Attribute2

Interface­Member­Attribute3

Interface­Member­Override­Strategy

Introduce­Attribute3

Introduction­Scope

Invalid­Advice­Parameters­Exception2

Invalid­Template­Signature­Exception2

IObject­Reader

ITemplate­Provider

Layers­Attribute2

meta

Method­Aspect3

Override­Event­Aspect4

Override­Field­Or­Property­Aspect4

Override­Method­Aspect4

Override­Strategy

Parameter­Aspect3

Property­Aspect3

Require­Aspect­Weaver­Attribute2

Run­Time­Attribute3

Run­Time­Or­Compile­Time­Attribute3

Scope­Attribute2

Template­Attribute2

Template­Invocation

Template­Provider

This­Attribute2

Type­Aspect3

Type­Parameter­Aspect3

Metalama.​Framework.​Code

Metalama.​Framework.​Code.​Collections

Metalama.​Framework.​Code.​Comparers

Metalama.​Framework.​Code.​Declaration­Builders

Metalama.​Framework.​Code.​Invokers

Metalama.​Framework.​Code.​Syntax­Builders

Metalama.​Framework.​Code.​Types

Metalama.​Framework.​Code­Fixes

Metalama.​Framework.​Diagnostics

Metalama.​Framework.​Eligibility

Metalama.​Framework.​Fabrics

Metalama.​Framework.​Metrics

Metalama.​Framework.​Options

Metalama.​Framework.​Project

Metalama.​Framework.​Run­Time

Metalama.​Framework.​Serialization

Metalama.​Framework.​Services

Metalama.​Framework.​Utilities

Metalama.​Framework.​Validation

Extensions API

Patterns API

Flashtrace API

Introspection API

Advanced API

Post­Sharp API migration

  • Article

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