예제 #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);
 }