Redigera

Dela via


ImmutableAttribute Class

Definition

The Immutable attribute indicates that instances of the marked class or struct are never modified after they are created.

[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct)]
public sealed class ImmutableAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct)>]
type ImmutableAttribute = class
    inherit Attribute
Public NotInheritable Class ImmutableAttribute
Inherits Attribute
Inheritance
ImmutableAttribute
Attributes

Remarks

Note that this implies that sub-objects are also not modified after the instance is created.

Constructors

ImmutableAttribute()

Applies to