StackExchangeRedisCacheServiceCollectionExtensions.AddStackExchangeRedisCache Method

Definition

Adds Redis distributed caching services to the specified IServiceCollection.

C#
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddStackExchangeRedisCache(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Action<Microsoft.Extensions.Caching.StackExchangeRedis.RedisCacheOptions> setupAction);

Parameters

services
IServiceCollection

The IServiceCollection to add services to.

setupAction
Action<RedisCacheOptions>

An Action<T> to configure the provided RedisCacheOptions.

Returns

The IServiceCollection so that additional calls can be chained.

Applies to

Producto Versiones
.NET 10 (package-provided)
.NET Standard 2.0 (package-provided)