Table of Contents

Interface IReadOnlyCache<TKey, TValue>

Namespace
LfrlAnvil.Caching
Assembly
LfrlAnvil.Core.dll

Represents a generic read-only cache of keyed entries.

public interface IReadOnlyCache<TKey, TValue> : IReadOnlyDictionary<TKey, TValue>, IReadOnlyCollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, IEnumerable where TKey : notnull

Type Parameters

TKey

Entry key (identifier) type.

TValue

Entry value type.

Inherited Members
Extension Methods

Properties

Capacity

Maximum capacity of this cache. Adding entries to caches whose capacity have been reached will cause their Oldest entry to be removed.

int Capacity { get; }

Property Value

int

Comparer

IEqualityComparer<T> instance used for key equality comparison.

IEqualityComparer<TKey> Comparer { get; }

Property Value

IEqualityComparer<TKey>

Oldest

Currently oldest cache entry.

KeyValuePair<TKey, TValue>? Oldest { get; }

Property Value

KeyValuePair<TKey, TValue>?

Remarks

This entry will be removed when new entry addition causes Count to exceed Capacity.