DataCacheItemVersion.CompareTo Method (DataCacheItemVersion)

 

Used to compare two versions of the same item, specified with the same key.

Namespace:   Microsoft.ApplicationServer.Caching
Assembly:  Microsoft.ApplicationServer.Caching.Core (in Microsoft.ApplicationServer.Caching.Core.dll)

Syntax

public int CompareTo(
    DataCacheItemVersion other
)
public:
virtual int CompareTo(
    DataCacheItemVersion^ other
) sealed
abstract CompareTo : 
        other:DataCacheItemVersion -> int
override CompareTo : 
        other:DataCacheItemVersion -> int
Public Function CompareTo (
    other As DataCacheItemVersion
) As Integer

Parameters

Return Value

Type: System.Int32

An Int32value: 0 if the versions are equal, greater than zero if the instance is greater than the version parameter value, or less than zero if the instance is less than the version parameter value.

Implements

IComparable<T>.CompareTo(T)

Remarks

Version comparisons are only meaningful when comparing versions of the same item, specified with the same key. It is not possible to deduce order by comparing versions from different keys; this method may return a result, but the result is only valid for versions of the same key.

The DataCacheItemVersion is updated every time that the object is updated. Only the latest version of the object is stored on the cache cluster. Due to the distributed nature of the cluster, the cache client may not have the latest copy of the object. For this reason, the DataCacheItemVersion class is essential for concurrency operations.

See Also

DataCacheItemVersion Class
Microsoft.ApplicationServer.Caching Namespace

Return to top