'Declaration Public Overloads Function Add(Of T)( _ ByVal key As System.String, _ ByVal value As T, _ ByVal absoluteExpiration As System.DateTimeOffset, _ Optional ByVal regionName As System.String _ ) As System.Boolean
'Usage Dim instance As SmartCache Dim key As System.String Dim value As T Dim absoluteExpiration As System.DateTimeOffset Dim regionName As System.String Dim value As System.Boolean value = instance.Add(Of T)(key, value, absoluteExpiration, regionName)
public System.bool Add<T>( System.string key, T value, System.DateTimeOffset absoluteExpiration, System.string regionName )
public: System.bool Add<T>( System.string* key, T* value, System.DateTimeOffset absoluteExpiration, System.string* regionName )
public: System.bool Addgeneric<typename T> ( System.String^ key, T^ value, System.DateTimeOffset absoluteExpiration, System.String^ regionName )
Parameters
- key
- A unique identifier for the cache entry.
- value
- The object to insert.
- absoluteExpiration
- The fixed date and time at which the cache entry will expire. This parameter is required when the System.Runtime.Caching.ObjectCache.Add(System.String,System.Object,System.DateTimeOffset,System.String) method is called.
- regionName
- Optional. A named region in the cache to which the cache entry can be added. Because regions are not implemented in .NET Framework 4, the default value is null.
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 key.