Exemplo n.º 1
0
        public static Boolean IsOrdered(IQueryable models)
        {
            GridQuery expression = new GridQuery();

            expression.Visit(models.Expression);

            return(expression.Ordered);
        }
Exemplo n.º 2
0
        public virtual IQueryable <T> Process(IQueryable <T> items)
        {
            TotalRows = items.Count();

            if (RowsPerPage == 0)
            {
                return(items);
            }

            if (!GridQuery.IsOrdered(items))
            {
                items = items.OrderBy(item => 0);
            }

            return(items.Skip((CurrentPage - 1) * RowsPerPage).Take(RowsPerPage));
        }