PostSharp / / API Reference / Post­Sharp.​Patterns.​Model / Pure­Attribute
Open sandbox

Class PureAttribute

Custom attribute that, when applied on a method, specifies that this method is a pure function, i.e. the method always returns the same result given the same parameter values. In the context of NotifyPropertyChangedAttribute, it is also assumed that pure functions have only parameters of primitive types (Int32, String, ...). The Object parameter type is also accepted, but then it is assumed that instances passed are immutable (and changes to these objects will not be tracked).

Namespace: PostSharp.Patterns.Model
Assembly: PostSharp.Patterns.Model.dll
public sealed class PureAttribute : MulticastAttribute, IValidableAnnotation


Name Description
PureAttribute() PostSharp.Patterns.Model.PureAttribute


Name Description

Method invoked at build time to ensure that the aspect has been applied to the right target.