Open
Description
Background and Motivation
With current overload of PersistKeysToStackExchangeRedis
, we could not use IConnectionMultiplexer
from service provider.
It makes us impossible to use Redis registered with AddRedisClient
of Aspire.
Proposed API
public static IDataProtectionBuilder PersistKeysToStackExchangeRedis(this IDataProtectionBuilder builder, Func<IServiceProvider, IDatabase> databaseFactory, RedisKey key);
Usage Examples
builder.AddRedisClient("redis");
builder.Services.AddDataProtection()
.PersistKeysToStackExchangeRedis(services => services.GetRequiredService<IConnectionMultiplexer>().GetDatabase(), "DataProtection-Keys");