IMemoryCache 介面

定義

表示值未經序列化的本機記憶體內部快取。Represents a local in-memory cache whose values are not serialized.

public interface class IMemoryCache : IDisposable
public interface IMemoryCache : IDisposable
type IMemoryCache = interface
    interface IDisposable
Public Interface IMemoryCache
Implements IDisposable
衍生
實作

方法

CreateEntry(Object)

建立或覆寫快取中的項目。Create or overwrite an entry in the cache.

Dispose()

執行與釋放 (Free)、釋放 (Release) 或重設 Unmanaged 資源相關聯之應用程式定義的工作。Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

(繼承來源 IDisposable)
Remove(Object)

移除與指定索引鍵建立關聯的物件。Removes the object associated with the given key.

TryGetValue(Object, Object)

取得與此索引鍵建立關聯的項目 (如有)。Gets the item associated with this key if present.

擴充方法

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)

適用於