Edit

Share via


ImmutableAttribute Class

Definition

Indicates that the type, type member, parameter, or return value which it is applied to should be treated as immutable and therefore that defensive copies are never required. When applied to non-sealed classes, derived types are not guaranteed to be immutable.

[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Field | System.AttributeTargets.Parameter | System.AttributeTargets.Property | System.AttributeTargets.ReturnValue | System.AttributeTargets.Struct, Inherited=false)]
public sealed class ImmutableAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Field | System.AttributeTargets.Parameter | System.AttributeTargets.Property | System.AttributeTargets.ReturnValue | System.AttributeTargets.Struct, Inherited=false)>]
type ImmutableAttribute = class
    inherit Attribute
Public NotInheritable Class ImmutableAttribute
Inherits Attribute
Inheritance
ImmutableAttribute
Attributes

Constructors

ImmutableAttribute()

Applies to

See also