PostSharpAPI ReferencePost­Sharp.​Patterns.​ThreadingImmutable­Attribute
Open sandboxFocus

ImmutableAttribute Class

Custom attribute that, when applied to a class, implements the ImmutableThreadingModel to this class. The aspect introduces the IImmutable interface into the target class. Immutable objects cannot be modified after the constructor exits.

Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Threading.dll
Syntax
[IntroduceInterface]
[Metric("UsedFeatures", "PostSharp.Patterns.Threading.Immutable")]
[Serializer]
public sealed class ImmutableAttribute : ReadOnlyThreadAwareAttribute, ITypeLevelAspect, ITypeLevelAspectBuildSemantics, IAspectBuildSemantics, IValidableAnnotation, ICloneAwareAspect, IInstanceScopedAspect, IAspectProvider, IService, IAdviceProvider, IAspect, IThreadAwareImplementationProvider, IQueryInterface, IConcurrencyController, IImmutable, IThreadAware

Constructors

Name Description
ImmutableAttribute()
ImmutableAttribute(PortableFormatterConstructorContext)

Methods

Name Description
OnInstanceConstructed()