Ejemplo n.º 1
0
        // GET: Orders
        public async Task <IActionResult> Index([FromQuery] int page = 1)
        {
            page--;
            var cnt = _context.Orders.Count();

            return(View(new DataViewModel <Order>()
            {
                Data = _cachedService.GetOrders().Skip(page * _pSize).Take(_pSize),
                PageCount = cnt / _pSize + (cnt % _pSize > 0 ? 1 : 0),
                CurrentPage = page
            }));
        }