示例#1
0
        public virtual void VisitGroupByClause(GroupByExpression <TContext> expression, QueryModel queryModel)
        {
            var visitor = new GroupByExpressionVisitor <TContext>(_args);

            visitor.Visit(expression);
            _spView.Query.GroupBy = visitor.Clause;
        }
示例#2
0
        public virtual void VisitGroupByClause(GroupByExpression <TContext> expression, QueryModel queryModel)
        {
            if (_args != null && _spView != null)
            {
                var visitor = new GroupByExpressionVisitor <TContext>(_args);
                visitor.Visit(expression);
                if (visitor.Clause != null)
                {
                    if (_spView.Query.GroupBy == null)
                    {
                        _spView.Query.GroupBy = visitor.Clause;
                    }
                    else
                    {
                        //visitor.Clause.Combine(_spView.Query.GroupBy);
                        //_spView.Query.GroupBy = visitor.Clause;

                        _spView.Query.GroupBy.Combine(visitor.Clause);
                        if (visitor.Clause.Limit > 0)
                        {
                            _spView.Query.GroupBy.Limit = visitor.Clause.Limit;
                        }
                    }
                }
            }
        }