Indicates that a method does not make any observable state changes.
The same as System.Diagnostics.Contracts.PureAttribute
Inheritance Hierarchy Namespace: Ozeki.CommonAssembly: OzekiSDK (in OzekiSDK.dll) Version: 10.4.98
Syntaxpublic sealed class PureAttribute : Attribute
Public NotInheritable Class PureAttribute
Inherits Attribute
public ref class PureAttribute sealed : public Attribute
[<SealedAttribute>]
type PureAttribute =
class
inherit Attribute
endThe PureAttribute type exposes the following members.
Constructors| | Name | Description |
|---|
 | PureAttribute | Initializes a new instance of the PureAttribute class |
Top
Example
[Pure] private int Multiply(int x, int y) { return x * y; }
public void Foo() {
const int a = 2, b = 2;
Multiply(a, b); // Waring: Return value of pure method is not used
}
See Also