Example #1
0
 public static ExprMerge WithSource(this ExprMerge original, IExprTableSource newSource)
 => new ExprMerge(targetTable: original.TargetTable, source: newSource, on: original.On, whenMatched: original.WhenMatched, whenNotMatchedByTarget: original.WhenNotMatchedByTarget, whenNotMatchedBySource: original.WhenNotMatchedBySource);
Example #2
0
 public static ExprJoinedTable WithRight(this ExprJoinedTable original, IExprTableSource newRight)
 => new ExprJoinedTable(left: original.Left, right: newRight, searchCondition: original.SearchCondition, joinType: original.JoinType);
Example #3
0
 public static ExprSelectOffsetFetch WithInnerJoin(this ExprSelectOffsetFetch select, IExprTableSource tableSource, ExprBoolean on)
 => select.SelectQuery is ExprQuerySpecification specification
Example #4
0
 public static ExprQuerySpecification WithInnerJoin(this ExprQuerySpecification querySpecification, IExprTableSource tableSource, ExprBoolean on)
 => JoinQuerySpecification(ExprJoinedTable.ExprJoinType.Inner, querySpecification, tableSource, on);
Example #5
0
 public static ExprCrossedTable WithRight(this ExprCrossedTable original, IExprTableSource newRight)
 => new ExprCrossedTable(left: original.Left, right: newRight);
Example #6
0
        private static ExprQuerySpecification JoinQuerySpecification(ExprJoinedTable.ExprJoinType exprJoinType,
                                                                     ExprQuerySpecification querySpecification, IExprTableSource tableSource, ExprBoolean @on)
        {
            if (querySpecification.From == null)
            {
                throw new SqExpressException("Query Specification \"From\" cannot be null");
            }

            var newJoin = new ExprJoinedTable(querySpecification.From, exprJoinType, tableSource, on);

            return(querySpecification.WithFrom(newJoin));
        }