Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more

Class WeakReferenceCache

Inheritance
System.Object
WeakReferenceCache
Namespace: EPiServer.Framework.Cache.Internal
Assembly: EPiServer.Framework.dll
Version: 12.0.3
Syntax
public class WeakReferenceCache : Object, IObjectInstanceCache

Constructors

WeakReferenceCache()

Declaration
public WeakReferenceCache()

WeakReferenceCache(Func<DateTime>)

Declaration
public WeakReferenceCache(Func<DateTime> currentTime)
Parameters
Type Name Description
System.Func<System.DateTime> 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.String key

The key.

Returns
Type Description
System.Object

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.String key

The key.

System.Object value

The value to cache.

CacheEvictionPolicy 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.String key

The key.

Implements

Extension Methods