NET Caching Library Help
Add<T>(CacheItem,CacheItemPolicy) Method




KellermanSoftware.NetCachingLibrary.CacheProviders Namespace > BaseCacheProvider Class > Add Method : Add<T>(CacheItem,CacheItemPolicy) Method
The object to add.
An object that contains eviction details for the cache entry. This object provides more options for eviction than a simple absolute expiration.
Tries to insert a cache entry into the cache as a System.Runtime.Caching.CacheItem instance, and adds details about how the entry should be evicted without overwriting any existing cache entry.
Syntax
'Declaration
 
Public Overloads Function Add(Of T)( _
   ByVal item As System.Runtime.Caching.CacheItem, _
   ByVal policy As System.Runtime.Caching.CacheItemPolicy _
) As System.Boolean
'Usage
 
Dim instance As BaseCacheProvider
Dim item As System.Runtime.Caching.CacheItem
Dim policy As System.Runtime.Caching.CacheItemPolicy
Dim value As System.Boolean
 
value = instance.Add(Of T)(item, policy)
public System.bool Add<T>( 
   System.Runtime.Caching.CacheItem item,
   System.Runtime.Caching.CacheItemPolicy policy
)
public: System.bool Add<T>( 
   System.Runtime.Caching.CacheItem* item,
   System.Runtime.Caching.CacheItemPolicy* policy
) 
public:
System.bool Addgeneric<typename T>
( 
   System.Runtime.Caching.CacheItem^ item,
   System.Runtime.Caching.CacheItemPolicy^ policy
) 

Parameters

item
The object to add.
policy
An object that contains eviction details for the cache entry. This object provides more options for eviction than a simple absolute expiration.

Type Parameters

T

Return Value

true if insertion succeeded, or false if there is an already an entry in the cache that has the same key as item.
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

BaseCacheProvider Class
BaseCacheProvider Members
Overload List