示例#1
0
        public IEnumerable <T> Process(IDataQueryable <T> items)
        {
            _pager.Initialize(items); //init pager

            int currentPage = _pager.CurrentPage;

            if (currentPage <= 0)
            {
                currentPage = 1;
            }

            int skip = (currentPage - 1) * _pager.PageSize;

            return(items.Fetch(skip, _pager.PageSize));
        }
示例#2
0
        protected void PrepareItemsToDisplay()
        {
            if (!_itemsProcessed)
            {
                _itemsProcessed = true;
                IDataQueryable <T> itemsToProcess = GridItems;

                if (_processor != null)
                {
                    AfterItems = _processor.Process(itemsToProcess);
                }
                else
                {
                    AfterItems = itemsToProcess.Fetch();
                }
            }
        }