2881099 / FreeRedis

🦄 FreeRedis is .NET40+ redis client. supports cluster, sentinel, master-slave, pub-sub, lua, pipeline, transaction, streams, client-side-caching, and pooling.
MIT License
924 stars 165 forks source link

怎么打印当前的数据库index #107

Open zpzhangwenhan opened 2 years ago

zpzhangwenhan commented 2 years ago

请问,我选择了某个数据库后,怎么输出索引号呢

var currentDb1 = cli.GetDatabase(1); 
var currentDb5 = cli.GetDatabase(5);
Console.WriteLine("databaseindex:") //这里如何写呢
2881099 commented 2 years ago

using (var db = cli.GetDatabase(1)) {

}

如果一定要选择数据库,请这样使用,否则遗漏释放很难排查问题。