diff --git a/docs/caching/stackexchange-redis-distributed-caching-integration.md b/docs/caching/stackexchange-redis-distributed-caching-integration.md index 7aa1d1e8ac..84aaba6c71 100644 --- a/docs/caching/stackexchange-redis-distributed-caching-integration.md +++ b/docs/caching/stackexchange-redis-distributed-caching-integration.md @@ -93,21 +93,21 @@ For more information on dependency injection, see [.NET dependency injection](/d ### Add keyed Redis client -There might be situations where you want to register multiple `IDistributedCache` instances with different connection names. To register keyed Redis clients, call the method: +Due to its limitations, you cannot register multiple `IDistributedCache` instances simultaneously. However, there may be scenarios where you need to register multiple Redis clients and use a specific `IDistributedCache` instance for a particular connection name. To register a keyed Redis client that will be used for the `IDistributedCache` service, call the method: ```csharp -builder.AddKeyedRedisDistributedCache(name: "chat"); +builder.AddKeyedRedisClient(name: "chat"); builder.AddKeyedRedisDistributedCache(name: "product"); ``` -Then you can retrieve the `IDistributedCache` instances using dependency injection. For example, to retrieve the connection from an example service: +Then you can retrieve the `IDistributedCache` instance using dependency injection. For example, to retrieve the connection from an example service: ```csharp public class ExampleService( - [FromKeyedServices("chat")] IDistributedCache chatCache, - [FromKeyedServices("product")] IDistributedCache productCache) + [FromKeyedServices("chat")] IConnectionMultiplexer chatConnectionMux, + IDistributedCache productCache) { - // Use caches... + // Use product cache... } ```