public override TwoStatementOpBase <TStatement, bool> DeepCloneWithStatement2(IReturningOperation <TStatement> statement2)
        {
            var result = new IsEqualToOp <TStatement>(
                this.Statement1?.DeepClone(),
                statement2);

            return(result);
        }
        protected override OperationBase DeepCloneInternal()
        {
            var result = new IsEqualToOp <TStatement>(
                this.Statement1?.DeepClone(),
                this.Statement2?.DeepClone());

            return(result);
        }
示例#3
0
        /// <summary>
        /// Builds an <see cref="IsEqualToOp{TResult}"/>.
        /// </summary>
        /// <typeparam name="TStatement">The type of the statements to compare.</typeparam>
        /// <param name="statement1">The first statement.</param>
        /// <param name="statement2">The second statement.</param>
        /// <returns>
        /// The operation.
        /// </returns>
        public static IsEqualToOp <TStatement> IsEqualTo <TStatement>(
            IReturningOperation <TStatement> statement1,
            IReturningOperation <TStatement> statement2)
        {
            var result = new IsEqualToOp <TStatement>(statement1, statement2);

            return(result);
        }
示例#4
0
        /// <inheritdoc />
        public async Task <bool> ExecuteAsync(
            IsEqualToOp <TResult> operation)
        {
            if (operation == null)
            {
                throw new ArgumentNullException(nameof(operation));
            }

            var value1 = await this.protocolFactory.GetProtocolAndExecuteViaReflectionAsync <TResult>(operation.Statement1);

            var value2 = await this.protocolFactory.GetProtocolAndExecuteViaReflectionAsync <TResult>(operation.Statement2);

            var result = value1.IsEqualTo(value2);

            return(result);
        }
        /// <inheritdoc />
        public bool Equals(IsEqualToOp <TStatement> other)
        {
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            if (ReferenceEquals(other, null))
            {
                return(false);
            }

            var result = this.Statement1.IsEqualTo(other.Statement1) &&
                         this.Statement2.IsEqualTo(other.Statement2);

            return(result);
        }