SHARE
TWEET

Untitled

a guest Jun 16th, 2019 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var currentPage = 1;
  2.                 List<Result> idList = new List<Result>();
  3.  
  4.                 var response = this.GetDocuments(currentPage).Result;
  5.                 //idList.AddRange(response.results);
  6.  
  7.                 var tasks = new List<Task>();
  8.  
  9.                 for (var i = 0; i < response.meta.page.total_pages; ++i)
  10.                 {
  11.                     var t = new Task(() =>
  12.                     {
  13.                         response = this.GetDocuments(i+1).Result;
  14.                         idList.AddRange(response.results);
  15.                     });
  16.                     tasks.Add(t);
  17.                     t.Start();
  18.                 }
  19.  
  20.                 Task.WhenAll(tasks).ConfigureAwait(false);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top