예제 #1
0
        internal long GetStringLength(string key)
        {
            if (_memCache.ContainsKey(key))
            {
                var value = _memCache.Get <RedisValue>(key);
                if (value.HasValue)
                {
                    RedisValue redisValue = value.Value;
                    if (redisValue.HasValue)
                    {
                        return(((string)redisValue).Length);
                    }
                }
            }

            return(0);
        }
예제 #2
0
        private Dictionary <string, RedisValue> GetHash(string hashKey)
        {
            var result = _objMemCache.Get <Dictionary <string, RedisValue> >(hashKey);

            if (result.HasValue)
            {
                return(result.Value);
            }
            else
            {
                return(null);
            }
        }
예제 #3
0
        private HashSet <RedisValue> GetSet(string setKey)
        {
            var result = _objMemCache.Get <HashSet <RedisValue> >(setKey);

            if (result.HasValue)
            {
                return(result.Value);
            }
            else
            {
                return(null);
            }
        }
        private DisjointedSortedSet GetSortedSet(string key)
        {
            var result = _objMemCache.Get <DisjointedSortedSet>(key);

            if (result.HasValue)
            {
                return(result.Value);
            }
            else
            {
                return(null);
            }
        }