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,以便可以链接其他调用。

适用于