Ejemplo n.º 1
0
 public IDatabase GetDatabase(string redisConnectionString = null, int db = 0, object asyncState = null)
 {
     if (string.IsNullOrWhiteSpace(redisConnectionString))
         throw new ArgumentNullException(redisConnectionString);
     var connect = DefaultRedisPersistentConnection.GetConnect(redisConnectionString);
     if (!connect.IsConnected())
     {
         connect = DefaultRedisPersistentConnection.TryConnect(redisConnectionString);
     }
     return connect.GetDatabase(db, asyncState);
 }
Ejemplo n.º 2
0
 public ISubscriber GetSubscriber(string redisConnectionString)
 {
     if (string.IsNullOrWhiteSpace(redisConnectionString))
         throw new ArgumentNullException(redisConnectionString);
     var connect = DefaultRedisPersistentConnection.GetConnect(redisConnectionString);
     if (!connect.IsConnected())
     {
         connect = DefaultRedisPersistentConnection.TryConnect(redisConnectionString);
     }
     return connect.GetSubscriber();
 }