Exemple #1
0
 public AggregateSubqueryExpression(TableAlias groupByAlias, Expression aggregateInGroupSelect, ScalarExpression aggregateAsSubquery)
     : base(DbExpressionType.AggregateSubquery, aggregateAsSubquery.Type)
 {
     this.aggregateInGroupSelect = aggregateInGroupSelect;
     this.groupByAlias           = groupByAlias;
     this.aggregateAsSubquery    = aggregateAsSubquery;
 }
 protected ScalarExpression UpdateScalar(ScalarExpression scalar, SelectExpression select)
 {
     if (select != scalar.Select)
     {
         return(new ScalarExpression(scalar.Type, select));
     }
     return(scalar);
 }
Exemple #3
0
 protected override Expression VisitScalar(ScalarExpression subquery)
 {
     Write("(");
     WriteLine(Indentation.Inner);
     Visit(subquery.Select);
     WriteLine(Indentation.Same);
     Write(")");
     Indent(Indentation.Outer);
     return(subquery);
 }
 protected virtual bool CompareScalar(ScalarExpression a, ScalarExpression b)
 {
     return(Compare(a.Select, b.Select));
 }
 protected AggregateSubqueryExpression UpdateAggregateSubquery(AggregateSubqueryExpression aggregate, ScalarExpression subquery)
 {
     if (subquery != aggregate.AggregateAsSubquery)
     {
         return(new AggregateSubqueryExpression(aggregate.GroupByAlias, aggregate.AggregateInGroupSelect, subquery));
     }
     return(aggregate);
 }
        protected virtual Expression VisitScalar(ScalarExpression scalar)
        {
            var select = (SelectExpression)Visit(scalar.Select);

            return(UpdateScalar(scalar, select));
        }