コード例 #1
0
        /// <summary>
        /// Does a logical negation of the operator.
        /// </summary>
        /// <returns>The resulting operator.</returns>
        public IOperator LogicallyNegate()
        {
            if (Operator == ExpressionType.Not)
            {
                return(InternalOperator);
            }

            InternalOperator = InternalOperator.LogicallyNegate();
            return(this);
        }
コード例 #2
0
        /// <summary>
        /// Optimizes the operator based on the mapping source.
        /// </summary>
        /// <param name="mappingSource">The mapping source.</param>
        /// <returns></returns>
        public IOperator Optimize(IMappingSource mappingSource)
        {
            InternalOperator = InternalOperator.Optimize(mappingSource);
            if (InternalOperator is null)
            {
                return(null !);
            }

            return(Operator == ExpressionType.Not ? InternalOperator.LogicallyNegate() : (this));
        }
コード例 #3
0
 /// <summary>
 /// Does a logical negation of the operator.
 /// </summary>
 /// <returns>The resulting operator.</returns>
 public IOperator LogicallyNegate()
 {
     InternalOperator = InternalOperator?.LogicallyNegate();
     return(this);
 }