ReadOnlyCollection <Expression> values; // either select or expressions are assigned /// <summary> /// /// </summary> /// <param name="expression"></param> /// <param name="select"></param> public InExpression(Expression expression, SelectExpression select) : base(DbExpressionType.In, typeof(bool), select) { this.expression = expression; }
/// <summary> /// /// </summary> /// <param name="type"></param> /// <param name="select"></param> public ScalarExpression(Type type, SelectExpression select) : base(DbExpressionType.Scalar, type, select) { }
/// <summary> /// /// </summary> /// <param name="select"></param> public ExistsExpression(SelectExpression select) : base(DbExpressionType.Exists, typeof(bool), select) { }
/// <summary> /// /// </summary> /// <param name="eType"></param> /// <param name="type"></param> /// <param name="select"></param> protected SubqueryExpression(DbExpressionType eType, Type type, SelectExpression select) : base(eType, type) { System.Diagnostics.Debug.Assert(eType == DbExpressionType.Scalar || eType == DbExpressionType.Exists || eType == DbExpressionType.In); this.select = select; }
/// <summary> /// /// </summary> /// <param name="select"></param> /// <param name="groupBy"></param> /// <returns></returns> public static SelectExpression SetGroupBy(this SelectExpression select, IEnumerable <Expression> groupBy) { return(new SelectExpression(select.Alias, select.Columns, select.From, select.Where, select.OrderBy, groupBy, select.IsDistinct, select.Skip, select.Take)); }
/// <summary> /// /// </summary> /// <param name="select"></param> /// <param name="columns"></param> /// <returns></returns> public static SelectExpression SetColumns(this SelectExpression select, IEnumerable <ColumnDeclaration> columns) { return(new SelectExpression(select.Alias, columns.OrderBy(c => c.Name), select.From, select.Where, select.OrderBy, select.GroupBy, select.IsDistinct, select.Skip, select.Take)); }
/// <summary> /// /// </summary> /// <param name="source"></param> /// <param name="projector"></param> public ProjectionExpression(SelectExpression source, Expression projector) : this(source, projector, null) { }
/// <summary> /// /// </summary> /// <param name="select"></param> /// <returns></returns> protected virtual Expression VisitSelect(SelectExpression select) { this.Write(select.QueryText); return(select); }