public override void VisitSelectClause(SelectClause selectClause, QueryModel queryModel) { if (queryModel.ResultOperators.FirstOrDefault() is AverageResultOperator) { var memberExpression = selectClause.Selector as MemberExpression; var memberNameResolver = new MemberNameResolver(memberExpression); Stack.Push(Stack.Pop().Avg(x => memberNameResolver.Resolve(x))); return; } if (queryModel.ResultOperators.FirstOrDefault() is CountResultOperator) { Stack.Push(Stack.Pop().Count( )); return; } var expr = GetSelectReqlAst(selectClause.Selector); if (!ReferenceEquals(expr, null)) { } base.VisitSelectClause(selectClause, queryModel); }
public override void VisitSelectClause( SelectClause selectClause, QueryModel queryModel ) { if( queryModel.ResultOperators.FirstOrDefault() is AverageResultOperator ) { var memberExpression = selectClause.Selector as MemberExpression; var memberNameResolver = new MemberNameResolver( memberExpression ); Stack.Push( Stack.Pop().Avg( x => memberNameResolver.Resolve( x ) ) ); return; } if( queryModel.ResultOperators.FirstOrDefault() is CountResultOperator ) { Stack.Push( Stack.Pop().Count( ) ); return; } var expr = GetSelectReqlAst( selectClause.Selector ); if( !ReferenceEquals( expr, null ) ) { } base.VisitSelectClause( selectClause, queryModel ); }