MemoryCache MemoryCache MemoryCache MemoryCache Class

Definition

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

public ref class MemoryCache : IDisposable, Microsoft::Extensions::Caching::Memory::IMemoryCache
public class MemoryCache : IDisposable, Microsoft.Extensions.Caching.Memory.IMemoryCache
type MemoryCache = class
    interface IMemoryCache
    interface IDisposable
Public Class MemoryCache
Implements IDisposable, IMemoryCache
Inheritance
MemoryCacheMemoryCacheMemoryCacheMemoryCache
Implements

Constructors

MemoryCache(IOptions<MemoryCacheOptions>) MemoryCache(IOptions<MemoryCacheOptions>) MemoryCache(IOptions<MemoryCacheOptions>) MemoryCache(IOptions<MemoryCacheOptions>)

Creates a new MemoryCache instance.

Properties

Count Count Count Count

Gets the count of the current entries for diagnostic purposes.

Methods

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

Cleans up the background collection events.

Remove(Object) Remove(Object) Remove(Object) Remove(Object)
TryGetValue(Object, Object) TryGetValue(Object, Object) TryGetValue(Object, Object) TryGetValue(Object, Object)

Extension Methods

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

Applies to