System.Diagnostics.Contracts.PureAttribute Class

Indicates that a type or method is pure, that is, it does not make any visible state changes.

See Also: PureAttribute Members

Syntax

[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Property | System.AttributeTargets.Event | System.AttributeTargets.Parameter | System.AttributeTargets.Delegate | System.AttributeTargets.All)]
[System.Diagnostics.Conditional("CONTRACTS_FULL")]
public sealed class PureAttribute : Attribute

Remarks

Methods and types that are marked with this attribute can be used in calls to System.Diagnostics.Contracts.Contract methods. Pure methods do not make any visible state changes. This attribute is not enforced by the current analysis tools; you should use this attribute only if you are sure that the methods are pure.

Requirements

Namespace: System.Diagnostics.Contracts
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 4.0.0.0