コード例 #1
0
        public async Task <T> HashGetAsync <T>(string key, string fieldName)
        {
            var redisValue = await Db.HashGetAsync(key, fieldName, CommandFlags.PreferSlave);

            return(redisValue.HasValue ? await Task.Factory.StartNew(() => (TConverter.ChangeType <T>(redisValue.ToString()))) : default(T));
        }
コード例 #2
0
        public T HashGet <T>(string key, string fieldName)
        {
            var redisValue = Db.HashGet(key, fieldName, CommandFlags.PreferSlave);

            return(redisValue.HasValue ? TConverter.ChangeType <T>(redisValue.ToString()) : default(T));
        }