Class that represents a cached item including its dependencies, expiration and eviction information

Namespace: Alachisoft.NCache.Web.Caching
Assembly: Alachisoft.NCache.Web (in Alachisoft.NCache.Web.dll) Version: 4.1.0.0 (4.1.0.0)

Syntax

C#
public class CacheItem : ICloneable
Visual Basic
Public Class CacheItem _
	Implements ICloneable
Visual C++
public ref class CacheItem : ICloneable

Examples

You can create an instance of CacheItem class and Add(String, Object) it to the Cache
CopyC#
object someData = new object();
CacheItem item = new CacheItem(someData);
item.SlidingExpiration = new TimeSpan(0,5,0);
item.Priority = CacheItemPriority.High;
item.ItemRemoveCallback = onRemove;
Cache cache = NCache.InitializeCache("myCache");
cache.Add("someData", item);

Inheritance Hierarchy

System..::..Object
  Alachisoft.NCache.Web.Caching..::..CacheItem

See Also