Class WeakReferenceCache
Inheritance
System.Object
WeakReferenceCache
Implements
Namespace: EPiServer.Framework.Cache.Internal
Assembly: EPiServer.Framework.dll
Version: 12.0.3Syntax
public class WeakReferenceCache : Object, IObjectInstanceCache
Constructors
WeakReferenceCache()
Declaration
public WeakReferenceCache()
WeakReferenceCache(Func<DateTime>)
Declaration
public WeakReferenceCache(Func<DateTime> currentTime)
Parameters
Type | Name | Description |
---|---|---|
System. |
currentTime |
Methods
Clear()
Removes all entries from the cache.
Declaration
public virtual void Clear()
Get(String)
Gets the specified object.
Declaration
public virtual object Get(string key)
Parameters
Type | Name | Description |
---|---|---|
System. |
key | The key. |
Returns
Type | Description |
---|---|
System. |
The object associated with the key, if it exists. Otherwise returns null. |
Insert(String, Object, CacheEvictionPolicy)
Inserts the value into the cache with the specified key.
Declaration
public virtual void Insert(string key, object value, CacheEvictionPolicy evictionPolicy)
Parameters
Type | Name | Description |
---|---|---|
System. |
key | The key. |
System. |
value | The value to cache. |
Cache |
evictionPolicy | The cache eviction policy. |
Remarks
The evicitionPolicy can be null. In that case the item may stay in the cache for an undetermined time.
Remove(String)
Removes the specified object.
Declaration
public virtual void Remove(string key)
Parameters
Type | Name | Description |
---|---|---|
System. |
key | The key. |