Class MemoryCache<TKey, TCachedObject>
- Namespace
- Dynamicweb.Caching
- Assembly
- Dynamicweb.Core.dll
Memory-cache implementation
public class MemoryCache<TKey, TCachedObject> : ServiceCache<TKey, TCachedObject>, IDisposable where TKey : IEquatable<TKey>
Type Parameters
TKey
Unique key for cached object
TCachedObject
Cached object
- Inheritance
-
ServiceCache<TKey, TCachedObject>MemoryCache<TKey, TCachedObject>
- Implements
- Inherited Members
Remarks
Will never initialize the full cache
Constructors
MemoryCache(Type)
Constructs a memory cache
public MemoryCache(Type owner)
Parameters
owner
Type
Properties
CountInternal
protected override int CountInternal { get; }
Property Value
Methods
ClearCacheInternal()
protected override void ClearCacheInternal()
GetAllValuesInternal()
protected override IEnumerable<TCachedObject> GetAllValuesInternal()
Returns
- IEnumerable<TCachedObject>
GetCacheKey(TKey)
protected override string GetCacheKey(TKey key)
Parameters
key
TKey
Returns
GetCacheResult(IEnumerable<TKey>)
Gets a cacheresult that contains found objects and the keys that could not be found
public override CacheResult<TKey, TCachedObject> GetCacheResult(IEnumerable<TKey> keys)
Parameters
keys
IEnumerable<TKey>Unique cachekeys
Returns
- CacheResult<TKey, TCachedObject>
cacheresult
IsValid()
protected override bool IsValid()
Returns
RemoveFromCache(IEnumerable<TKey>)
protected override void RemoveFromCache(IEnumerable<TKey> keys)
Parameters
keys
IEnumerable<TKey>
SetCacheInternal(TKey, TCachedObject)
protected override void SetCacheInternal(TKey key, TCachedObject cachedObject)
Parameters
key
TKeycachedObject
TCachedObject
SetCacheInternal(TKey, TCachedObject, TKey?)
protected override void SetCacheInternal(TKey key, TCachedObject cachedObject, TKey? parentKey)
Parameters
key
TKeycachedObject
TCachedObjectparentKey
TKey