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

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

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

            return(true);
        }