Language

Cache.GetIfNewer Method (String, ref CacheItemVersion)

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

Gets an object from the cache, but only if a newer version of the object occurs in the cache.

Namespace: System.Data.Caching
Assembly: ClientLibrary (in clientlibrary.dll)

Syntax

'Declaration
Public Function GetIfNewer ( _
    key As String, _
    ByRef version As CacheItemVersion _
) As Object
'Usage
Dim instance As Cache
Dim key As String
Dim version As CacheItemVersion
Dim returnValue As Object

returnValue = instance.GetIfNewer(key, version)
public Object GetIfNewer (
    string key,
    ref CacheItemVersion version
)
public:
Object^ GetIfNewer (
    String^ key, 
    CacheItemVersion^% version
)
public Object GetIfNewer (
    String key, 
    /** @ref */ CacheItemVersion version
)
JScript does not support passing value-type arguments by reference.

Parameters

  • key
    The unique value that is used to identify the object in the cache. If this parameter is null, an exception is thrown.
  • version
    The version of the desired object, passed by reference. If this parameter is null, an exception is thrown.

Return Value

If the version in the cache differs from the version parameter, the corresponding cached object is returned. If the version in the cache is the same as the version parameter, null is returned.

Remarks

This method helps avoid unnecessary network traffic. For more information about concurrency, see Concurrency Models (Velocity) and Concurrency Methods (Velocity).

See Also

Reference

Cache Class
Cache Members
System.Data.Caching Namespace