MetalamaAPI documentationExtensions APIMetalama.​Extensions.​Multicast
Open sandboxFocus

Metalama.Extensions.Multicast Namespace



A base class that can be used to build aspects that mimics PostSharp attribute multicasting. This class implements multicasting from the assembly- or type-level custom attributes. Implementations of this class must provide the other implementations of the IAspect<T> generic interface for the final type of declarations.


Attributes (i.e. in C# terms, modifiers) of elements to which multicast custom attributes (IMulticastAttribute) apply.


A reusable implementation of the multicasting logic. Each multicast-enabled aspect must contain an instance of the MulticastImplementation class and should call its BuildAspect<T>(IAspectBuilder<T>, Action<IAspectBuilder<T>>) method. to perform multicasting.


In Metalama, aspect inheritance is ruled at the class level by the InheritableAttribute custom attribute. In Metalama itself, only Strict inheritance is implemented. MulticastAspect and MulticastImplementation implement an emulation of the Multicast inheritance mode by passing the proper parameter to the constructor.


Kinds of targets to which multicast aspects (IMulticastAttribute) can be applied.


An aspect equivalent to OverrideFieldOrPropertyAspect that also implements multicasting for backward compatibility with PostSharp.


An aspect equivalent to OverrideMethodAspect that also implements multicasting for backward compatibility with PostSharp.



An interface that exposes properties that are equivalent those of the PostSharp MulticastAttribute. Multicast aspects in Metalama should implement this interface. All properties should be implemented as automatic properties.