Example #1
0
        /// <summary>
        /// Builds an <see cref="OrElseOp"/>.
        /// </summary>
        /// <param name="statements">The statements.</param>
        /// <returns>
        /// The operation.
        /// </returns>
        public static OrElseOp OrElse(
            params IReturningOperation <bool>[] statements)
        {
            var result = new OrElseOp(statements);

            return(result);
        }
Example #2
0
        /// <inheritdoc />
        public async Task <bool> ExecuteAsync(
            OrElseOp operation)
        {
            if (operation == null)
            {
                throw new ArgumentNullException(nameof(operation));
            }

            foreach (var statement in operation.Statements)
            {
                if (await this.protocolFactory.GetProtocolAndExecuteViaReflectionAsync <bool>(statement))
                {
                    return(true);
                }
            }

            return(false);
        }