예제 #1
0
        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);
        }
예제 #2
0
        public List <Invoice> GetAll(Filters.InvoiceFilterOptions options = null, PagingSettings paging = null)
        {
            var invoices = QueryInvoices(options, paging);

            return(invoices.ToList());
        }
예제 #3
0
 public int Total(Filters.InvoiceFilterOptions options)
 {
     return(Repository.Total(options));
 }
예제 #4
0
 public int Total(Filters.InvoiceFilterOptions options)
 {
     return(QueryInvoices(options).Count());
 }
예제 #5
0
 public List <Invoice> GetAll(Filters.InvoiceFilterOptions options = null, PagingSettings paging = null)
 {
     return(Repository.GetAll(options, paging));
 }