protected override Expression VisitExcept(ExceptExpression exceptExpression)
 {
     return(exceptExpression?.Update(
                exceptExpression.Source1.VisitNode(this),
                exceptExpression.Source2.VisitNode(this)
                ));
 }
        protected override Expression VisitExcept(ExceptExpression exceptExpression)
        {
            Check.NotNull(exceptExpression, nameof(exceptExpression));

            GenerateSetOperationHelper(exceptExpression);

            return(exceptExpression);
        }
예제 #3
0
 private BsonValue TranslateExcept(ExceptExpression node)
 {
     return(new BsonDocument("$setDifference", new BsonArray(new[]
     {
         TranslateValue(node.Source),
         TranslateValue(node.Other)
     })));
 }
        protected override Expression VisitExcept(ExceptExpression exceptExpression)
        {
            var canOptimize = _canOptimize;

            _canOptimize = false;
            var source1 = (SelectExpression)Visit(exceptExpression.Source1);
            var source2 = (SelectExpression)Visit(exceptExpression.Source2);

            _canOptimize = canOptimize;

            return(exceptExpression.Update(source1, source2));
        }
        protected override Expression VisitExcept(ExceptExpression exceptExpression)
        {
            var parentSearchCondition = _isSearchCondition;

            _isSearchCondition = false;
            var source1 = (SelectExpression)Visit(exceptExpression.Source1);
            var source2 = (SelectExpression)Visit(exceptExpression.Source2);

            _isSearchCondition = parentSearchCondition;

            return(exceptExpression.Update(source1, source2));
        }
        protected virtual void GenerateSetOperation(SetOperationBase setOperation)
        {
            string getSetOperation() => setOperation switch
            {
                ExceptExpression _ => "EXCEPT",
                IntersectExpression _ => "INTERSECT",
                UnionExpression _ => "UNION",
                                 _ => throw new InvalidOperationException("Unknown SetOperationType."),
            };

            GenerateSetOperationOperand(setOperation, setOperation.Source1);
            _relationalCommandBuilder.AppendLine();
            _relationalCommandBuilder.AppendLine($"{getSetOperation()}{(setOperation.IsDistinct ? "" : " ALL")}");
            GenerateSetOperationOperand(setOperation, setOperation.Source2);
        }
        protected virtual void GenerateSetOperation([NotNull] SetOperationBase setOperation)
        {
            Check.NotNull(setOperation, nameof(setOperation));

            string getSetOperation() => setOperation switch
            {
                ExceptExpression _ => "EXCEPT",
                IntersectExpression _ => "INTERSECT",
                UnionExpression _ => "UNION",
                                 _ => throw new InvalidOperationException(CoreStrings.UnknownEntity("SetOperationType")),
            };

            GenerateSetOperationOperand(setOperation, setOperation.Source1);
            _relationalCommandBuilder.AppendLine();
            _relationalCommandBuilder.AppendLine($"{getSetOperation()}{(setOperation.IsDistinct ? "" : " ALL")}");
            GenerateSetOperationOperand(setOperation, setOperation.Source2);
        }
예제 #8
0
 /// <summary>
 ///     Visits the children of the except expression.
 /// </summary>
 /// <param name="exceptExpression"> The expression to visit. </param>
 /// <returns> The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. </returns>
 protected abstract Expression VisitExcept([NotNull] ExceptExpression exceptExpression);
예제 #9
0
 protected virtual Expression VisitExcept(ExceptExpression exceptExpression)
 => CheckSupport(exceptExpression, false);
        protected override Expression VisitExcept(ExceptExpression exceptExpression)
        {
            GenerateSetOperationHelper(exceptExpression);

            return(exceptExpression);
        }
예제 #11
0
 protected abstract Expression VisitExcept(ExceptExpression exceptExpression);
예제 #12
0
 protected override Expression VisitExcept(ExceptExpression exceptExpression)
 {
     return(exceptExpression);
 }
예제 #13
0
 protected virtual Expression VisitExcept(ExceptExpression exceptExpression)
 => CheckSupport(exceptExpression, _options.ServerVersion.SupportsExceptIntercept);