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
TKeyTEntry
- Inherited Members
- Extension Methods
Methods
CreateEntry(TKey)
Create or overwrite an entry in the cache.
ICacheEntry<TKey, TEntry> CreateEntry(TKey key)
Parameters
keyTKeyAn 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
keyTKeyAn 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
keyTKeyAn object identifying the requested entry.
valueTEntryThe located value or null.
Returns
- bool
True if the key was found.