NDepend.API Documentation
PureAttribute Class
Members 
NDepend.Attributes Namespace : PureAttribute Class
This attribute can be used to declare a method as pure.
Syntax
[AttributeUsage(AttributeTargets.Method)]
public sealed class PureAttribute : System.Attribute 
Remarks
A method is pure if it cannot be called in a way to provoque a side-effect.
The properties IMethod.NDepend.CodeModel.IMethod.ChangesObjectState and IMethod.NDepend.CodeModel.IMethod.ChangesTypeState can be used to determine whether a method is pure or not.
A code rule is provided by default to continuously make sure that all methods tagged with this attribute are pure.
A code rule is provided by default to continuously make sure that all pure methods are tagged with this attribute.
Since .NET v4, you can also use the attribute type System.Diagnostics.Contracts.PureAttribute declared in mscorlib (only for VS projects on which Microsoft Code Contract is enabled, else the PureAttribute is discarded by the compiler).
Inheritance Hierarchy

System.Object
   System.Attribute
      NDepend.Attributes.PureAttribute

Requirements

Target Platforms: Windows 11, 10, 8, 7 and Linux, MacOS with net8.0, net7.0 or net6.0 installed

See Also

Reference

PureAttribute Members
NDepend.Attributes Namespace
ChangesObjectState Property
ChangesTypeState Property
HasAttribute Method
HasAttribute Method
AttributeClassesThatTagMe Property