Ejemplo n.º 1
0
        // Constructor

        internal SqlJoinedTable(SqlJoinExpression joinExpression)
        {
            this.joinExpression = joinExpression;
            var joinedColumns = joinExpression.Left.Columns.Concat(joinExpression.Right.Columns).ToList();

            columns        = new SqlTableColumnCollection(joinedColumns);
            AliasedColumns = new SqlColumnCollection(columns.Cast <SqlColumn>().ToList());
        }
        internal override object Clone(SqlNodeCloneContext context)
        {
            if (context.NodeMapping.ContainsKey(this))
            {
                return(context.NodeMapping[this]);
            }

            var clone = new SqlJoinExpression(JoinType,
                                              Left == null ? null : (SqlTable)Left.Clone(context),
                                              Right == null ? null : (SqlTable)Right.Clone(context),
                                              Expression == null ? null : (SqlExpression)Expression.Clone(context));

            context.NodeMapping[this] = clone;
            return(clone);
        }
Ejemplo n.º 3
0
        internal SqlJoinedTable(SqlJoinExpression joinExpression, IReadOnlyList <SqlColumn> leftColumns, IReadOnlyList <SqlColumn> rightColumns)
        {
            this.joinExpression = joinExpression;
            var allLeftColumns  = joinExpression.Left.Columns;
            var allRightColumns = joinExpression.Right.Columns;

            var joinedColumns = new List <SqlTableColumn>(allLeftColumns.Count + allRightColumns.Count);

            joinedColumns.AddRange(allLeftColumns);
            joinedColumns.AddRange(allRightColumns);
            columns = new SqlTableColumnCollection(joinedColumns);

            var aliasedColumns = new List <SqlColumn>(leftColumns.Count + rightColumns.Count);

            aliasedColumns.AddRange(leftColumns);
            aliasedColumns.AddRange(rightColumns);
            AliasedColumns = new SqlColumnCollection(aliasedColumns);
        }
Ejemplo n.º 4
0
        // Constructor

        internal SqlJoinedTable(SqlJoinExpression joinExpression)
            : this(joinExpression, joinExpression.Left.Columns, joinExpression.Right.Columns)
        {
        }
Ejemplo n.º 5
0
 internal SqlJoinedTable(SqlJoinExpression joinExpression, IEnumerable <SqlColumn> leftColumns, IEnumerable <SqlColumn> rightColumns)
     : this(joinExpression)
 {
     AliasedColumns = new SqlColumnCollection(leftColumns.Concat(rightColumns).ToList());
 }