Esempio n. 1
0
        public Task Watch(params string[] keys) =>
        ExecuteWithSession(async session =>
        {
            if (keys == null || !keys.Any() || keys.All(string.IsNullOrWhiteSpace))
            {
                throw new InvalidOperationException(
                    "Key list was null, empty or contained only invalid strings");
            }

            var result = await _transactionClient.Watch(session, keys).ConfigureAwait(false);

            if (result.IsFailure)
            {
                throw new RedisException(
                    $"Error while watching keys '{string.Join(", ", keys)}' [REDIS CODE: {result.Error}]",
                    result.Exception);
            }
        });