Class NoCache<TKey, TCachedObject>
- Namespace
- Dynamicweb.Caching
- Assembly
- Dynamicweb.Caching.dll
No-Cache implementation intended to be used to disable cache
public class NoCache<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>NoCache<TKey, TCachedObject>
- Implements
- Inherited Members
Constructors
NoCache(Type)
Constructs a cache that never stores anything
public NoCache(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>
GetCache(TKey)
Gets the object that uniquely matches the provided key, if the object is present in the cache.
public override TCachedObject GetCache(TKey key)
Parameters
key
TKey- Cachekey that is unique for the cached object
Returns
- TCachedObject
- cached object found
GetCache(IEnumerable<TKey>)
Gets the objects that uniquely matches the provides keys, if the objects are present in the cache.
public override IEnumerable<TCachedObject> GetCache(IEnumerable<TKey> keys)
Parameters
keys
IEnumerable<TKey>- CacheKeys unique per cacheobject
Returns
- IEnumerable<TCachedObject>
- cached objects found
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