Esempio n. 1
0
 public AggregateSubqueryExpression(TableAlias groupByAlias, Expression aggregateInGroupSelect, ScalarExpression aggregateAsSubquery)
     : base(DbExpressionType.AggregateSubquery, aggregateAsSubquery.Type)
 {
     this.aggregateInGroupSelect = aggregateInGroupSelect;
     this.groupByAlias           = groupByAlias;
     this.aggregateAsSubquery    = aggregateAsSubquery;
 }
Esempio n. 2
0
        protected virtual Expression VisitScalar(ScalarExpression scalar)
        {
            SelectExpression select = (SelectExpression)this.Visit(scalar.Select);

            if (select != scalar.Select)
            {
                return(new ScalarExpression(scalar.Type, select));
            }
            return(scalar);
        }
Esempio n. 3
0
        protected virtual Expression VisitAggregateSubquery(AggregateSubqueryExpression aggregate)
        {
            Expression e = this.Visit(aggregate.AggregateAsSubquery);

            System.Diagnostics.Debug.Assert(e is ScalarExpression);
            ScalarExpression subquery = (ScalarExpression)e;

            if (subquery != aggregate.AggregateAsSubquery)
            {
                return(new AggregateSubqueryExpression(aggregate.GroupByAlias, aggregate.AggregateInGroupSelect, subquery));
            }
            return(aggregate);
        }
Esempio n. 4
0
 protected virtual bool CompareScalar(ScalarExpression a, ScalarExpression b)
 {
     return(Compare(a.Select, b.Select));
 }