My C# function returns 100 list objects at a time. I want to fill a list until this function does not return any lists.
I am trying to do something like this:
int lastSelectedId = 0;
while(ReturnListOfCustomers(lastSelectedId).Count > 0)
{
List<Customers> newCustomers = ReturnListOfCustomers(lastSelectedId);
CustomerList.Append(newCustomers);
lastSelectedId = newCustomers.Last().rowid;
}
…but in this case I will have to call ReturnListOfCustomers function twice per loop,
can I make it better by calling it one at a time?
Thanks.
You can use do/while