MemoryCache Class

Definition

An implementation of IMemoryCache using a dictionary to store its entries.

public class MemoryCache : IDisposable, Microsoft.Extensions.Caching.Memory.IMemoryCache
Inheritance
MemoryCache
Implements

Constructors

MemoryCache(IOptions<MemoryCacheOptions>)

Creates a new MemoryCache instance.

Properties

Count

Gets the count of the current entries for diagnostic purposes.

Methods

Compact(Double)
CreateEntry(Object)
Dispose()
Dispose(Boolean)
Finalize()

Cleans up the background collection events.

Remove(Object)
TryGetValue(Object, Object)

Extension Methods

Get(IMemoryCache, Object)
Get<TItem>(IMemoryCache, Object)
GetOrCreate<TItem>(IMemoryCache, Object, Func<ICacheEntry,TItem>)
GetOrCreateAsync<TItem>(IMemoryCache, Object, Func<ICacheEntry,Task<TItem>>)
Set<TItem>(IMemoryCache, Object, TItem)
Set<TItem>(IMemoryCache, Object, TItem, MemoryCacheEntryOptions)
Set<TItem>(IMemoryCache, Object, TItem, IChangeToken)
Set<TItem>(IMemoryCache, Object, TItem, DateTimeOffset)
Set<TItem>(IMemoryCache, Object, TItem, TimeSpan)
TryGetValue<TItem>(IMemoryCache, Object, TItem)

Applies to