共用方式為


StackExchangeRedisCacheServiceCollectionExtensions.AddStackExchangeRedisCache 方法

定義

將 Redis 分散式快取服務新增至指定的 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

要新增服務的 IServiceCollection

setupAction
Action<RedisCacheOptions>

用於設定所提供 RedisCacheOptionsAction<T>

傳回

IServiceCollection,以便鏈結其他呼叫。

適用於