我的 C# 函数一次返回 100 个列表对象。我想填写一个列表,直到这个函数不返回任何列表。
我正在尝试做这样的事情:
int lastSelectedId = 0;
while(ReturnListOfCustomers(lastSelectedId).Count > 0)
{
List<Customers> newCustomers = ReturnListOfCustomers(lastSelectedId);
CustomerList.Append(newCustomers);
lastSelectedId = newCustomers.Last().rowid;
}
...但在这种情况下,我将不得不在ReturnListOfCustomers
每个循环中调用两次函数,我可以通过一次调用一个来使其更好吗?
谢谢。