Class ImmutableAttribute
- Namespace
- NDepend.Attributes
- Assembly
- NDepend.API.dll
This attribute can be used to declare a type as immutable.
[AttributeUsage(AttributeTargets.Class|AttributeTargets.Struct)]
public sealed class ImmutableAttribute : Attribute
- Inheritance
-
ImmutableAttribute
- Inherited Members
- Extension Methods
Remarks
A class or structure is immutable if its instance object's state, cannot be modified after it is created. This is in contrast to a mutable object, which can be modified after it is created.
The property IType.IsImmutable can be used to determine whether a type is immutable or not.
A code rule is provided by default to continuously make sure that all types tagged with this attribute are indeed immutable.
A code rule is provided by default to continuously make sure that all immutable types are tagged with this attribute.
Constructor (1)
ImmutableAttribute()
Create a new instance of the PureAttribute class.
public ImmutableAttribute()