Beispiel #1
0
        public GenericResult <Product> Get(int page, int items)
        {
            var totalRows = Count();

            return(new GenericResult <Product>(
                       _context.Products.OrderBy(c => c.Name).Where(c => c.IsActive)
                       .Skip(PaginatorHelper.CalculateOffset(page, items, totalRows)).Take(items).ToList(),
                       page,
                       items,
                       totalRows));
        }
        public GenericResult <Sale> Get(int page, int items)
        {
            var totalRows = Count();

            return(new GenericResult <Sale>(
                       _context.Sales.Include(s => s.SaleProducts).Include(s => s.Customer).OrderByDescending(c => c.Id).Where(c => c.IsActive).Skip(PaginatorHelper.CalculateOffset(page, items, totalRows)).Take(items).ToList(),
                       page,
                       items,
                       totalRows));
        }