RedisCacheServiceCollectionExtensions.AddDistributedRedisCache(IServiceCollection, Action<RedisCacheOptions>) 方法

定義

將 Redis 分散式快取服務新增至指定的 IServiceCollectionAdds Redis distributed caching services to the specified IServiceCollection.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddDistributedRedisCache(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, Action<Microsoft::Extensions::Caching::Redis::RedisCacheOptions ^> ^ setupAction);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddDistributedRedisCache (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Action<Microsoft.Extensions.Caching.Redis.RedisCacheOptions> setupAction);
static member AddDistributedRedisCache : Microsoft.Extensions.DependencyInjection.IServiceCollection * Action<Microsoft.Extensions.Caching.Redis.RedisCacheOptions> -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddDistributedRedisCache (services As IServiceCollection, setupAction As Action(Of RedisCacheOptions)) As IServiceCollection

參數

services
IServiceCollection

要新增服務的 IServiceCollectionThe IServiceCollection to add services to.

setupAction
Action<RedisCacheOptions>

用於設定所提供 RedisCacheOptionsAction<T>An Action<T> to configure the provided RedisCacheOptions.

傳回

IServiceCollection,讓其他呼叫可以進行鏈結。The IServiceCollection so that additional calls can be chained.

適用於