Table of Contents

Interface IMemoryCache<TKey, TEntry>

Namespace
LinqToDB.Common.Internal.Cache
Assembly
linq2db.dll

Represents a local in-memory cache whose values are not serialized.

public interface IMemoryCache<TKey, TEntry> : IDisposable where TKey : notnull

Type Parameters

TKey
TEntry
Inherited Members
Extension Methods

Methods

CreateEntry(TKey)

Create or overwrite an entry in the cache.

ICacheEntry<TKey, TEntry> CreateEntry(TKey key)

Parameters

key TKey

An object identifying the entry.

Returns

ICacheEntry<TKey, TEntry>

The newly created ICacheEntry<TKey, TEntity> instance.

Remove(TKey)

Removes the object associated with the given key.

void Remove(TKey key)

Parameters

key TKey

An object identifying the entry.

TryGetValue(TKey, out TEntry)

Gets the item associated with this key if present.

bool TryGetValue(TKey key, out TEntry value)

Parameters

key TKey

An object identifying the requested entry.

value TEntry

The located value or null.

Returns

bool

True if the key was found.