Esempio n. 1
0
 public List<Objects.Product> Get(Util.GridOptions options, ProductFiltering filter)
 {
     List<Objects.Product> lst = new List<Objects.Product>();
     foreach (var p in context.Products.Where(x => x.CompanyId.Value == filter.CompanyId)
         .Where(filter.Filter())
         .OrderBy(options.OrderBy, options.OrderDescending)
         .Skip(options.Skip)
         .Take(options.RowsPerPage))
         lst.Add(new Objects.Product(p));
     return lst;
 }
Esempio n. 2
0
 public int GetCount(ProductFiltering filter)
 {
     return context.Products.Where(x => x.CompanyId.Value == filter.CompanyId)
         .Where(filter.Filter()).Count();
 }