Пример #1
0
 public GroupExpression(Expression groupedExpression, Expression keyExpression)
     : base(ExpressionType, groupedExpression.Type)
 {
     GroupedExpression = groupedExpression;
     KeyExpression = keyExpression;
     Clauses = new List<Expression>();
     // extract columns (for SQL build)
     keyExpression.Recurse(
         delegate(Expression e)
             {
                 if (e is ColumnExpression)
                     Clauses.Add(e);
                 return e;
             }
         );
 }
 /// <summary>
 /// Translate a hierarchy's SpecialExpressions to Expressions
 /// </summary>
 /// <param name="expression"></param>
 /// <returns></returns>
 public Expression Translate(Expression expression)
 {
     return expression.Recurse(Analyzer);
 }
Пример #3
0
 protected virtual bool IsHavingClause(Expression expression)
 {
     bool isHaving = false;
     expression.Recurse(delegate(Expression e)
                            {
                                if (e is GroupExpression)
                                    isHaving = true;
                                return e;
                            });
     return isHaving;
 }
Пример #4
0
 public virtual Expression Parse(Expression expression, BuilderContext builderContext)
 {
     return expression.Recurse(e => Analyze(e, builderContext));
 }
 //RI: adding this to get all child columns in GroupExpression
 private IList<ColumnExpression> GetChildColumns(Expression expression, TranslationContext context)
 {
     var columns = new List<ColumnExpression>();
       // extract columns (for SQL build)
       expression.Recurse(
       delegate(Expression e) {
         if (e is ColumnExpression)
           columns.Add((ColumnExpression)e);
         else if (e is TableExpression) {
           var t = (TableExpression)e;
           columns.AddRange(RegisterAllColumns(t, context));
         }
         return e;
       }//
       );
       return columns;
 }
Пример #6
0
 public virtual Expression Optimize(Expression expression, TranslationContext rewriterContext)
 {
     return expression.Recurse(e => Analyze(e, rewriterContext));
 }