Example #1
0
        public async ValueTask <string> Add(object data, int?maxlen, string id)
        {
            Commands.XADD cmd = new Commands.XADD(Name, id);
            cmd.DataFormater = mDB.DataFormater;
            cmd.MAXLEN       = maxlen;
            cmd.Data         = data;
            var result = await mDB.Execute(cmd, typeof(string));

            result.Throw();
            return((string)result.Value);
        }
Example #2
0
        public async ValueTask <long> SAdd(string key, params string[] members)
        {
            Commands.SETS_SADD cmd = new Commands.SETS_SADD(key, members);
            var result             = await mDB.Execute(cmd, typeof(string));

            if (result.IsError)
            {
                throw new RedisException(result.Messge);
            }
            return((long)result.Value);
        }