Gets an object from the cache only if a newer version of the object exists in cache.
Namespace: Alachisoft.NCache.Web.CachingAssembly: Alachisoft.NCache.Web (in Alachisoft.NCache.Web.dll) Version: 4.1.0.0 (4.1.0.0)
Syntax
C# |
---|
public virtual Object GetIfNewer( string key, string group, string subGroup, ref CacheItemVersion version ) |
Visual Basic |
---|
Public Overridable Function GetIfNewer ( _ key As String, _ group As String, _ subGroup As String, _ ByRef version As CacheItemVersion _ ) As Object |
Visual C++ |
---|
public: virtual Object^ GetIfNewer( String^ key, String^ group, String^ subGroup, CacheItemVersion^% version ) |
Parameters
- key
- Type: System..::..String
key used to reference the desired object
- group
- Type: System..::..String
The group of the cached object
- subGroup
- Type: System..::..String
The subGroup of the cached object
- version
- Type: Alachisoft.NCache.Web.Caching..::..CacheItemVersion%
The version of the desired object passed by reference.
Return Value
If a newer object exists in the cache, the object is returned. Otherwise, null is returned.Examples
The following example demonstrates how to get a newer version of the item from cache if it exists.
CopyC#
Cache cache = NCache.InitializeCache("myCache"); cache.GetIfNewer("key", "Alpha", null, ref itemVersion);