private MappedCacheClientBase(string basePrefix, RedisConfiguration conf) { DataPrefix = "data:" + basePrefix + ':'; KeySetKey = "keys:" + basePrefix; CacheClient = new RedisHybridCacheClient(new RedisCacheClientOptions { ConnectionMultiplexer = ConnectionMultiplexer.Connect(new ConfigurationOptions { Password = conf.Password, EndPoints = { $"{conf.Host}:{conf.Port}" } // todo config }), Serializer = new JsonNetSerializer(new JsonSerializerSettings { ContractResolver = new CamelCasePropertyNamesContractResolver() }), }); }
private GenericRedisCacheClient(string basePrefix, RedisConfiguration conf) { DataPrefix = "data:" + basePrefix + ':'; KeySetKey = "keys:" + basePrefix; var tmp = new RedisCacheClientOptions { ConnectionMultiplexer = ConnectionMultiplexer.Connect(new ConfigurationOptions { Password = conf.Password, EndPoints = { $"{conf.Host}:{conf.Port}" }, }), Serializer = new JsonNetSerializer(new JsonSerializerSettings { }) }; CacheClient = new RedisHybridCacheClient(tmp); Log.Info($"Connected to redis : {conf.Host}"); }
protected MappedCacheClientBase(RedisConfiguration conf) : this(typeof(TObject).Name.ToLower(), conf) { }
protected GenericRedisCacheClient(RedisConfiguration conf) : this(typeof(TObject).Name.ToLower(), conf) { }