MemoryCacheServiceCollectionExtensions.AddDistributedMemoryCache メソッド
定義
オーバーロード
AddDistributedMemoryCache(IServiceCollection) |
メモリに項目を格納する IDistributedCache の既定の実装を IServiceCollection に追加します。Adds a default implementation of IDistributedCache that stores items in memory to the IServiceCollection. 動作に分散キャッシュを必要とするフレームワークでは、その依存関係一覧の一部としてこの依存関係を安全に追加し、実装が少なくとも 1 つ利用できるように手配できます。Frameworks that require a distributed cache to work can safely add this dependency as part of their dependency list to ensure that there is at least one implementation available. |
AddDistributedMemoryCache(IServiceCollection, Action<MemoryDistributedCacheOptions>) |
メモリに項目を格納する IDistributedCache の既定の実装を IServiceCollection に追加します。Adds a default implementation of IDistributedCache that stores items in memory to the IServiceCollection. 動作に分散キャッシュを必要とするフレームワークでは、その依存関係一覧の一部としてこの依存関係を安全に追加し、実装が少なくとも 1 つ利用できるように手配できます。Frameworks that require a distributed cache to work can safely add this dependency as part of their dependency list to ensure that there is at least one implementation available. |
AddDistributedMemoryCache(IServiceCollection)
メモリに項目を格納する IDistributedCache の既定の実装を IServiceCollection に追加します。Adds a default implementation of IDistributedCache that stores items in memory to the IServiceCollection. 動作に分散キャッシュを必要とするフレームワークでは、その依存関係一覧の一部としてこの依存関係を安全に追加し、実装が少なくとも 1 つ利用できるように手配できます。Frameworks that require a distributed cache to work can safely add this dependency as part of their dependency list to ensure that there is at least one implementation available.
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddDistributedMemoryCache(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddDistributedMemoryCache (this Microsoft.Extensions.DependencyInjection.IServiceCollection services);
static member AddDistributedMemoryCache : Microsoft.Extensions.DependencyInjection.IServiceCollection -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddDistributedMemoryCache (services As IServiceCollection) As IServiceCollection
パラメーター
- services
- IServiceCollection
サービスを追加する先の IServiceCollection。The IServiceCollection to add services to.
戻り値
追加の呼び出しをチェーンできるようにする IServiceCollection。The IServiceCollection so that additional calls can be chained.
注釈
AddDistributedMemoryCache(IServiceCollection)このキャッシュは項目をメモリに格納し、複数のコンピューター間で拡張しないため、単一サーバーのシナリオでのみ使用してください。AddDistributedMemoryCache(IServiceCollection) should only be used in single server scenarios as this cache stores items in memory and doesn't expand across multiple machines. これらのシナリオでは、複数のコンピューター間で拡張できる適切な分散キャッシュを使用することをお勧めします。For those scenarios it is recommended to use a proper distributed cache that can expand across multiple machines.
適用対象
AddDistributedMemoryCache(IServiceCollection, Action<MemoryDistributedCacheOptions>)
メモリに項目を格納する IDistributedCache の既定の実装を IServiceCollection に追加します。Adds a default implementation of IDistributedCache that stores items in memory to the IServiceCollection. 動作に分散キャッシュを必要とするフレームワークでは、その依存関係一覧の一部としてこの依存関係を安全に追加し、実装が少なくとも 1 つ利用できるように手配できます。Frameworks that require a distributed cache to work can safely add this dependency as part of their dependency list to ensure that there is at least one implementation available.
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddDistributedMemoryCache(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, Action<Microsoft::Extensions::Caching::Memory::MemoryDistributedCacheOptions ^> ^ setupAction);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddDistributedMemoryCache (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Action<Microsoft.Extensions.Caching.Memory.MemoryDistributedCacheOptions> setupAction);
static member AddDistributedMemoryCache : Microsoft.Extensions.DependencyInjection.IServiceCollection * Action<Microsoft.Extensions.Caching.Memory.MemoryDistributedCacheOptions> -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddDistributedMemoryCache (services As IServiceCollection, setupAction As Action(Of MemoryDistributedCacheOptions)) As IServiceCollection
パラメーター
- services
- IServiceCollection
サービスを追加する先の IServiceCollection。The IServiceCollection to add services to.
- setupAction
- Action<MemoryDistributedCacheOptions>
指定した MemoryDistributedCacheOptions を構成する Action<T>。The Action<T> to configure the provided MemoryDistributedCacheOptions.
戻り値
追加の呼び出しをチェーンできるようにする IServiceCollection。The IServiceCollection so that additional calls can be chained.
注釈
AddDistributedMemoryCache(IServiceCollection)このキャッシュは項目をメモリに格納し、複数のコンピューター間で拡張しないため、単一サーバーのシナリオでのみ使用してください。AddDistributedMemoryCache(IServiceCollection) should only be used in single server scenarios as this cache stores items in memory and doesn't expand across multiple machines. これらのシナリオでは、複数のコンピューター間で拡張できる適切な分散キャッシュを使用することをお勧めします。For those scenarios it is recommended to use a proper distributed cache that can expand across multiple machines.