I am part of a software team that is writing a console application (no UI) in C#. My part in the team is to write code to call RESTful APIs from a third party site, process the returned data and save it to the local database.
The third party API has a cap on the number of items returned in a single call (100 items max) which requires me to call the same API multiple times over a loop to retrieve all data which often runs into many thousands of records. Once a single record is retrieved, I need to make more API calls to get further details of the record that is retrieved which requires multiple loops again due to record cap imposed by the third party API.
All in all the process ended up being many levels of nested loops! I can't think of a better of way managing this process without so many nested loops. I thought about using lambda style expressions to enumerate items but I read somewhere that lambda expressions are syntactic sugar on loops! Any ideas that might improve the code without using nested, long painful loops?