public RedisHelper(ConnectionMultiplexer redis, int?dbNum) { //Retrieve the Redis DB with the specified number (by default, there are 16), default to 0. var db = redis.GetDatabase(dbNum.HasValue ? dbNum.Value : 0); //Initialize helper / wrappers with the database. Database = new RedisDatabaseHelper(db); Streams = new RedisStreamsHelper(db); }
public RedisDbRepository() { //Gubantorious 4.21.18 - We need to make sure we persist this connection, we don't want multiple connections within the app //Implementing now for testability, we will want to blend this into the repository / DI patterns _redis = new RedisStreamsHelper(ConnectionMultiplexer.Connect("localhost")); }