DataCache.GetIfNewer Method (String, ref DataCacheItemVersion)

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

Namespace: Microsoft.ApplicationServer.Caching
Assembly: Microsoft.ApplicationServer.Caching.Client (in microsoft.applicationserver.caching.client.dll)


Dim instance As DataCache
Dim key As String
Dim version As DataCacheItemVersion
Dim returnValue As Object

returnValue = instance.GetIfNewer(key, version)


Public Function GetIfNewer ( _
    key As String, _
    ByRef version As DataCacheItemVersion _
) As Object
public Object GetIfNewer (
    string key,
    ref DataCacheItemVersion version
Object^ GetIfNewer (
    String^ key, 
    DataCacheItemVersion^% version
public Object GetIfNewer (
    String key, 
    /** @ref */ DataCacheItemVersion version


  • key
    The unique value that is used to identify the object in the cache.
  • version
    The version of the desired object, passed by reference.

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.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.


Development Platforms

Visual Studio 2010 and later, .NET Framework 4

Target Platforms

Windows 7; Windows Server 2008 R2; Windows Server 2008 Service Pack 2; Windows Vista Service Pack 2

See Also


DataCache Class
DataCache Members
Microsoft.ApplicationServer.Caching Namespace

  ff425062(v=azure.10).md 2011-08-26