示例#1
0
        static RedisContainerCacheStrategy()
        {
            var cache = RedisManager.GetClient();

            var testKey   = Guid.NewGuid().ToString();
            var testValue = Guid.NewGuid().ToString();

            cache.Set(testKey, testValue);
            var storeValue = cache.Get <string>(testKey);

            if (storeValue != testValue)
            {
                throw new Exception("RedisStrategy失效,没有计入缓存!");
            }
            cache.Remove(testKey);
        }
 public RedisContainerCacheStrategy()
 {
     //_config = RedisConfigInfo.GetConfig();
     _client = RedisManager.GetClient();
     _cache  = _client.As <IContainerItemCollection>();
 }