1

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 ?

1 Answer 1

1

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";
    }); 
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.