Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Redis Cache databaseId #9587


User avatar
0
zyrel.sermon created

Hi

in the code below, is it possible to set the DatabaseId programatically based on the current connection string of the database?

Configuration.Caching.UseRedis(options => { options.ConnectionString = _appConfiguration["RedisCache:ConnectionString"]; options.DatabaseId = _appConfiguration.GetValue<int>("RedisCache:DatabaseId"); });

Please Advise, Thanks


1 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team

    hi @zyrel.sermon

    You can consider replace the AbpRedisCacheDatabaseProvider service.

    https://github.com/aspnetboilerplate/aspnetboilerplate/blob/b39157d04b845804687542e89a0b506847f73537/src/Abp.RedisCache/Runtime/Caching/Redis/AbpRedisCacheDatabaseProvider.cs#L10