I am calling a API which I am taking data from server. When The response have nextpageToken, The function call itself with pagetoken.
The code is working fine but it's make stackoverflow Exception. If this thing need to be called 350 times (method call itself everytime with new pagetoken) it's make stackoverflow exception.
for example this is the code.
public static void GetData(Channel info, string pagetoken =null)
{
// get the data from api
GetData(info,pagetoken)
// enter into database
return;
}
Someone please check how to figure this out. Previously I run some child thing in Task but it's failed because the API hits too fast so I remove that Task.
Now it's single threaded code and it's still not work perfectly.