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




KellermanSoftware.NetCachingLibrary.CacheProviders Namespace > BaseCacheProvider Class > Add Method : Add<T>(String,T,CacheItemPolicy,String) Method
A unique identifier for the cache entry.
The object to insert.
An object that contains eviction details for the cache entry. This object provides more options for eviction than a simple absolute expiration.
Optional. A named region in the cache to which the cache entry can be added. The default value for the optional parameter is Default
Inserts a cache entry into the cache without overwriting any existing cache entry, specifying information about how the entry will be evicted.
Syntax
'Declaration
 
Public Overloads Function Add(Of T)( _
   ByVal key As System.String, _
   ByVal value As T, _
   ByVal policy As System.Runtime.Caching.CacheItemPolicy, _
   Optional ByVal regionName As System.String _
) As System.Boolean
'Usage
 
Dim instance As BaseCacheProvider
Dim key As System.String
Dim value As T
Dim policy As System.Runtime.Caching.CacheItemPolicy
Dim regionName As System.String
Dim value As System.Boolean
 
value = instance.Add(Of T)(key, value, policy, regionName)
public System.bool Add<T>( 
   System.string key,
   T value,
   System.Runtime.Caching.CacheItemPolicy policy,
   System.string regionName
)
public: System.bool Add<T>( 
   System.string* key,
   T* value,
   System.Runtime.Caching.CacheItemPolicy* policy,
   System.string* regionName
) 
public:
System.bool Addgeneric<typename T>
( 
   System.String^ key,
   T^ value,
   System.Runtime.Caching.CacheItemPolicy^ policy,
   System.String^ regionName
) 

Parameters

key
A unique identifier for the cache entry.
value
The object to insert.
policy
An object that contains eviction details for the cache entry. This object provides more options for eviction than a simple absolute expiration.
regionName
Optional. A named region in the cache to which the cache entry can be added. The default value for the optional parameter is Default

Type Parameters

T

Return Value

true if the insertion try succeeds, or false if there is an already an entry in the cache with the same key as key.
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