Interface IMemoryCache<TKey, TEntry>
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
TKeyAn 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
TKeyAn 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
TKeyAn object identifying the requested entry.
value
TEntryThe located value or null.
Returns
- bool
True if the key was found.