Example #1
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="dbNum">数据库编号</param>
 /// <param name="readWriteHosts">链接地址</param>
 public RedisHelper(int dbNum, string readWriteHosts)
 {
     this.DbNum  = dbNum;
     this._conn  = string.IsNullOrWhiteSpace(readWriteHosts) ? RedisConnectionHelper.Instance : RedisConnectionHelper.GetConnectionMultiplexer(readWriteHosts);
     _serializer = new DefaultRedisCacheSerializer();
 }
Example #2
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="dbNum">数据库编号</param>
 public RedisHelper(int dbNum = 0) : this(dbNum, null)
 {
     _serializer = new DefaultRedisCacheSerializer();
 }