예제 #1
0
        public static void Push(RedisObject redisObject, string queueName)
        {
            if (string.IsNullOrWhiteSpace(queueName))
            {
                throw new ArgumentNullException(nameof(queueName));
            }
            var db = RedisClient.Client.GetDatabase();

            db.ListLeftPushAsync(queueName, JsonHelper.Serialize(redisObject));
        }
        public static void Add(string key, RedisObject redisObject, string hashTableName)
        {
            if (string.IsNullOrWhiteSpace(hashTableName))
            {
                throw new ArgumentNullException(nameof(hashTableName));
            }
            var db = RedisClient.Client.GetDatabase();

            db.HashSetAsync(hashTableName, new[] { new HashEntry(key, JsonHelper.Serialize(redisObject)) });
        }