コード例 #1
0
        protected Expression VisitUnion(UnionExpression unionExpression)
        {
            var canOptimize = _canOptimize;

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

            _canOptimize = canOptimize;

            return(unionExpression.Update(source1, source2));
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        protected Expression VisitUnion(UnionExpression unionExpression)
        {
            GenerateSetOperationHelper(unionExpression);

            return(unionExpression);
        }