private IQueryable <Invoice> QueryInvoices(Filters.InvoiceFilterOptions options, PagingSettings paging = null) { var invoices = Context.Invoice.Where(i => !i.Deleted.HasValue); if (options != null) { if (options.Order == "desc") { invoices = invoices.OrderByDescending(x => x.CreatedDate); } } if (paging != null) { invoices = invoices.Distinct().OrderByDescending(l => l.CreatedDate).ToPagedQueryable(paging); } return(invoices); }
public List <Invoice> GetAll(Filters.InvoiceFilterOptions options = null, PagingSettings paging = null) { var invoices = QueryInvoices(options, paging); return(invoices.ToList()); }
public int Total(Filters.InvoiceFilterOptions options) { return(Repository.Total(options)); }
public int Total(Filters.InvoiceFilterOptions options) { return(QueryInvoices(options).Count()); }
public List <Invoice> GetAll(Filters.InvoiceFilterOptions options = null, PagingSettings paging = null) { return(Repository.GetAll(options, paging)); }