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
MemoryCache
Implements

Constructors

MemoryCache(IOptions<MemoryCacheOptions>)

Creates a new MemoryCache instance.

MemoryCache(IOptions<MemoryCacheOptions>, ILoggerFactory)

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)
Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
Finalize()

Cleans up the background collection events.

GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
Remove(Object)
ToString()

Returns a string that represents the current object.

(Inherited from 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