DataCacheItemVersion.CompareTo Method

[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

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

Namespace: Microsoft.Data.Caching
Assembly: CacheBaseLibrary (in cachebaselibrary.dll)

Syntax

'Declaration
Public Function CompareTo ( _
    version As DataCacheItemVersion _
) As Integer
'Usage
Dim instance As DataCacheItemVersion
Dim version As DataCacheItemVersion
Dim returnValue As Integer

returnValue = instance.CompareTo(version)
public int CompareTo (
    DataCacheItemVersion version
)
public:
virtual int CompareTo (
    DataCacheItemVersion^ version
) sealed
public final int CompareTo (
    DataCacheItemVersion version
)
public final function CompareTo (
    version : DataCacheItemVersion
) : int

Parameters

Return Value

An integer value: 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.

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. For more information, see Concurrency Models (Velocity) and Concurrency Methods (Velocity).

See Also

Reference

DataCacheItemVersion Class
DataCacheItemVersion Members
Microsoft.Data.Caching Namespace