SALES: 1-800-867-1380
CompareTo Method
Collapse the table of content
Expand the table of content

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)

public int CompareTo(
	DataCacheItemVersion other
)

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.

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.

Return to top
Show:
© 2016 Microsoft