AssumeImmutableAttribute Class |
Custom attribute that, when applied to a targetType, means that targetType should be assumed to be immutable.
The custom attribute can be applied to a type on assembly level by specifying the Type property using
the AssumeImmutableAttribute(Type) constructor.
Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Common (in PostSharp.Patterns.Common.dll) Version: 2023.0.3.0 (2023.0.3.0)
C#
public sealed class AssumeImmutableAttribute : Attribute
The AssumeImmutableAttribute type exposes the following members.
Name | Description | |
---|---|---|
AssumeImmutableAttribute() |
Initializes a new instance of the AssumeImmutableAttribute custom attribute that can be applied to a specific targetType.
| |
AssumeImmutableAttribute(Type) |
Initializes a new instance of the AssumeImmutableAttribute custom attribute that can be applied to an assembly,
passing the immutable as a constructor argument. This constructor allows to add assumptions for types that are not defined
in this current assembly.
|
Name | Description | |
---|---|---|
TargetType |
Gets the targetType that should be assumed immutable, if the AssumeImmutableAttribute(Type) constructor was used.
|