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); }
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); }
/// <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);
protected virtual Expression VisitExcept(ExceptExpression exceptExpression) => CheckSupport(exceptExpression, false);
protected override Expression VisitExcept(ExceptExpression exceptExpression) { GenerateSetOperationHelper(exceptExpression); return(exceptExpression); }
protected abstract Expression VisitExcept(ExceptExpression exceptExpression);
protected override Expression VisitExcept(ExceptExpression exceptExpression) { return(exceptExpression); }
protected virtual Expression VisitExcept(ExceptExpression exceptExpression) => CheckSupport(exceptExpression, _options.ServerVersion.SupportsExceptIntercept);