Reputation: 159
My Redis DB has many instances (db0, db1, db2 ...). I am using each instance for for different environments.
I configured distributed cache object to as following:
services.AddDistributedRedisCache(options =>
{
options.Configuration = "localhost";
options.InstanceName = "SampleInstance";
});
With the StackExchange.Redis I could get the db. How do I do it here ?
Upvotes: 1
Views: 2720
Reputation: 159
I found the answer here:
https://stackexchange.github.io/StackExchange.Redis/Configuration
In the follwoing example I work with the 'db7' instance:
services.AddDistributedRedisCache(options =>
{
options.Configuration = "localhost, defaultDatabase=7";
});
Upvotes: 1