Skip to content

Instantly share code, notes, and snippets.

@henzard
Created April 12, 2016 19:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save henzard/429c67ab9dabec49a96b99cf91c3d145 to your computer and use it in GitHub Desktop.
Save henzard/429c67ab9dabec49a96b99cf91c3d145 to your computer and use it in GitHub Desktop.
List<Invoice> AllInvoices = new List<Invoice>();
List<Invoice> CurrentInvoices = new List<Invoice>();
int i = 1;
CurrentInvoices = _api.Invoices.Page(i).Find().OrderBy(e => e.DueDate).ToList();
while(CurrentInvoices != null)
{
AllInvoices.AddRange(CurrentInvoices);
i++;
CurrentInvoices = _api.Invoices.Page(i).Find().OrderBy(e => e.DueDate).ToList();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment