Open sandboxFocus

Class CompositionAspect

There is no composition aspect in Metalama, but you can build one by deriving the TypeAspect type, implementing the BuildAspect(IAspectBuilder<INamedType>) method, and calling builder.Advice.ImplementInterface(INamedType, INamedType, OverrideStrategy, object?). There is no concept of protected interface in Metalama.

Inheritance
CompositionAspect
Namespace: PostSharp.Aspects
Assembly: Metalama.Migration.dll
Syntax
[AttributeUsage(AttributeTargets.Assembly|AttributeTargets.Class|AttributeTargets.Struct, AllowMultiple = true, Inherited = false)]
[MulticastAttributeUsage(MulticastTargets.Class|MulticastTargets.Struct, AllowMultiple = true)]
[Obsolete("There is no composition aspect in Metalama, but you can build one by deriving the 'TypeAspect' type, implementing the 'TypeAspect.BuildAspect(IAspectBuilder<INamedType>)' method, and calling <c>builder</c>.'IAspectBuilder.Advice'.'IAdviceFactory.ImplementInterface(INamedType, INamedType, OverrideStrategy, object?)'. There is no concept of protected interface in Metalama.", false)]
public abstract class CompositionAspect : TypeLevelAspect, ITypeLevelAspectBuildSemantics, IAspectBuildSemantics, IValidableAnnotation, ICompositionAspect, ITypeLevelAspect, IAspect

Constructors

Name Description
CompositionAspect()

Properties

Name Description
AncestorOverrideAction
GenerateImplementationAccessor

There is no equivalent to this feature in Metalama.

NonSerializedImplementation

Implementations are always non-serializable by default in Metalama.

OverrideAction

Equivalent to the OverrideStrategy parameter passed to the ImplementInterface(INamedType, INamedType, OverrideStrategy, object?) method.

Methods

Name Description
CreateAspectConfiguration()

Not supported in Metalama.

CreateImplementationObject(AdviceArgs)

In Metalama, you would typically have this code in an initializer added to the type using AddInitializer(INamedType, string, InitializerKind, object?, object?).

GetPublicInterfaces(Type)

The interface type is passed as a parameter to the ImplementInterface(INamedType, INamedType, OverrideStrategy, object?) method.

SetAspectConfiguration(AspectConfiguration, Type)