Gets an object from the cache only if a newer version of the object exists in cache.

Namespace: Alachisoft.NCache.Web.Caching
Assembly: Alachisoft.NCache.Web (in Alachisoft.NCache.Web.dll) Version: 4.3.0.0 (4.3.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

Type: Object
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.
 Copy imageCopy
Cache cache = NCache.InitializeCache("myCache");
cache.GetIfNewer("key", "Alpha", null, ref itemVersion);

See Also