/// <summary> /// /// </summary> /// <param name="type"></param> /// <param name="alias"></param> /// <param name="name"></param> public ColumnExpression(Type type, TableAlias alias, string name) : base(DbExpressionType.Column, type) { this.alias = alias; this.name = name; }
/// <summary> /// /// </summary> /// <param name="nodeType"></param> /// <param name="type"></param> /// <param name="alias"></param> protected AliasedExpression(DbExpressionType nodeType, Type type, TableAlias alias) : base(nodeType, type) { this.alias = alias; }
/// <summary> /// /// </summary> /// <param name="alias"></param> /// <param name="name"></param> public TableExpression(TableAlias alias, string name) : base(DbExpressionType.Table, typeof(void), alias) { this.name = name; }
/// <summary> /// /// </summary> /// <param name="select"></param> /// <param name="newAlias"></param> /// <returns></returns> public static SelectExpression AddRedundantSelect(this SelectExpression select, TableAlias newAlias) { var newColumns = select.Columns.Select(d => new ColumnDeclaration(d.Name, new ColumnExpression(d.Expression.Type, newAlias, d.Name))); var newFrom = new SelectExpression(newAlias, select.Columns, select.From, select.Where, select.OrderBy, select.GroupBy, select.IsDistinct, select.Skip, select.Take); return(new SelectExpression(select.Alias, newColumns, newFrom, null, null, null, false, null, null)); }