Skip to content

Add PersistKeysToStackExchangeRedis overload which accepts Func<IServiceProvider, IDatabase> #61768

Open
@RamType0

Description

@RamType0

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");

Metadata

Metadata

Assignees

No one assigned

    Labels

    api-suggestionEarly API idea and discussion, it is NOT ready for implementationarea-dataprotectionIncludes: DataProtection

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions