Ejemplo n.º 1
0
 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());
 }
Ejemplo n.º 2
0
 public IEnumerable <Product> GetWithCategory(Product.Categories category)
 {
     return(WebshopContext.Products
            .Where(x => x.Category == category));
 }