私のC#関数は、一度に100個のリストオブジェクトを返します。この関数がリストを返さなくなるまでリストを埋めたいです。
私はこのようなことをしようとしています:
int lastSelectedId = 0;
while(ReturnListOfCustomers(lastSelectedId).Count > 0)
{
List<Customers> newCustomers = ReturnListOfCustomers(lastSelectedId);
CustomerList.Append(newCustomers);
lastSelectedId = newCustomers.Last().rowid;
}
...しかし、この場合ReturnListOfCustomers
、ループごとに2回関数を呼び出す必要がありますが、一度に1つずつ呼び出すことで、関数を改善できますか?
ありがとう。