StackExchangeRedisCacheServiceCollectionExtensions.AddStackExchangeRedisCache(IServiceCollection, Action<RedisCacheOptions>) 方法

定義

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

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddStackExchangeRedisCache(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, Action<Microsoft::Extensions::Caching::StackExchangeRedis::RedisCacheOptions ^> ^ setupAction);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddStackExchangeRedisCache (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Action<Microsoft.Extensions.Caching.StackExchangeRedis.RedisCacheOptions> setupAction);
static member AddStackExchangeRedisCache : Microsoft.Extensions.DependencyInjection.IServiceCollection * Action<Microsoft.Extensions.Caching.StackExchangeRedis.RedisCacheOptions> -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddStackExchangeRedisCache (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

IServiceCollection,以便鏈結其他呼叫。The IServiceCollection so that additional calls can be chained.

適用於