MemoryCacheServiceCollectionExtensions 類別

定義

IServiceCollection 中設定記憶體快取相關服務的擴充方法。

public ref class MemoryCacheServiceCollectionExtensions abstract sealed
public static class MemoryCacheServiceCollectionExtensions
type MemoryCacheServiceCollectionExtensions = class
Public Module MemoryCacheServiceCollectionExtensions
繼承
MemoryCacheServiceCollectionExtensions

方法

AddDistributedMemoryCache(IServiceCollection)

新增 IDistributedCache 的預設實作,將記憶體中的項目儲存至 IServiceCollection。 需要分散式快取才能運作的架構,可以安全地將此相依性新增為其相依性清單的一部分,以確保至少有一個可用的實作。

AddDistributedMemoryCache(IServiceCollection, Action<MemoryDistributedCacheOptions>)

新增 IDistributedCache 的預設實作,將記憶體中的項目儲存至 IServiceCollection。 需要分散式快取才能運作的架構,可以安全地將此相依性新增為其相依性清單的一部分,以確保至少有一個可用的實作。

AddMemoryCache(IServiceCollection)

IMemoryCache 的非分散式記憶體內實作新增至 IServiceCollection

AddMemoryCache(IServiceCollection, Action<MemoryCacheOptions>)

IMemoryCache 的非分散式記憶體內實作新增至 IServiceCollection

適用於