예제 #1
0
        S IAstVisitor <T, S> .VisitQueryGroupClause(QueryGroupClause queryGroupClause, T data)
        {
            var handler = QueryGroupClauseVisited;

            if (handler != null)
            {
                handler(queryGroupClause, data);
            }
            return(VisitChildren(queryGroupClause, data));
        }
예제 #2
0
            public override AstNode VisitQueryGroupClause(QueryGroupClause queryGroupClause)
            {
                var param     = CreateParameterForCurrentRangeVariable();
                var keyLambda = CreateLambda(new[] { param }, VisitNested(queryGroupClause.Key, param));

                if (IsSingleRangeVariable(queryGroupClause.Projection))
                {
                    // We are grouping by the single active range variable, so we can use the single argument form of GroupBy
                    return(currentResult.Invoke("GroupBy", keyLambda));
                }
                else
                {
                    var projectionParam  = CreateParameterForCurrentRangeVariable();
                    var projectionLambda = CreateLambda(new[] { projectionParam }, VisitNested(queryGroupClause.Projection, projectionParam));
                    return(currentResult.Invoke("GroupBy", keyLambda, projectionLambda));
                }
            }
예제 #3
0
 void IAstVisitor.VisitQueryGroupClause(QueryGroupClause queryGroupClause)
 {
     Visit(EnterQueryGroupClause, LeaveQueryGroupClause, queryGroupClause);
 }
예제 #4
0
        protected internal override bool DoMatch(AstNode other, PatternMatching.Match match)
        {
            QueryGroupClause o = other as QueryGroupClause;

            return(o != null && this.Projection.DoMatch(o.Projection, match) && this.Key.DoMatch(o.Key, match));
        }