Open sandboxFocus

Interface IClearableMemoryCache

An IMemoryCache that can remove all of its entries.

Namespace: Metalama.Patterns.Caching.Implementation
Assembly: Metalama.Patterns.Caching.Backend.dll
Syntax
public interface IClearableMemoryCache : IMemoryCache, IDisposable
Remarks

MemoryCache exposes these two operations, but IMemoryCache does not declare them.

Metalama.Patterns.Caching.Backends.MemoryCachingBackend calls Compact(double) when a cache that it owns is cleared with Compact. It does not call Clear(): it clears its own items one key at a time, on any IMemoryCache, so that the other entries of a shared cache are kept.

Methods

Name Description
Clear()

Removes all entries.

Compact(double)

Removes the given percentage of the entries.

Extension Methods