public IEnumerable <Product> GetWithCategoryPaginated(Product.Categories category, int pageIndex, int pageSize = 10) { return(WebshopContext.Products .Where(x => x.Category == category) .OrderBy(p => p.Name) .Skip((pageIndex - 1) * pageSize) .Take(pageSize) .ToList()); }
public IEnumerable <Product> GetWithCategory(Product.Categories category) { return(WebshopContext.Products .Where(x => x.Category == category)); }