S IAstVisitor <T, S> .VisitQueryGroupClause(QueryGroupClause queryGroupClause, T data) { var handler = QueryGroupClauseVisited; if (handler != null) { handler(queryGroupClause, data); } return(VisitChildren(queryGroupClause, data)); }
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)); } }
void IAstVisitor.VisitQueryGroupClause(QueryGroupClause queryGroupClause) { Visit(EnterQueryGroupClause, LeaveQueryGroupClause, queryGroupClause); }
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)); }