static void BeginExecuteSegmentedIsDone(IAsyncResult result) { CloudTableQuery <Entities.Product> CloudQuery = result.AsyncState as CloudTableQuery <Entities.Product>; var resultSegment = CloudQuery.EndExecuteSegmented(result); List <Entities.Product> listSongs = resultSegment.Results.ToList <Entities.Product>(); if (resultSegment.HasMoreResults) { IAsyncResult iAsyncResult = CloudQuery.BeginExecuteSegmented(resultSegment.ContinuationToken, BeginExecuteSegmentedIsDone, CloudQuery); } }
private void ResultAvailable(IAsyncResult asyncResult) { try { var result = _query.EndExecuteSegmented(asyncResult); _result.AddRange(result.Results); if (result.HasMoreResults) { _query.BeginExecuteSegmented(result.ContinuationToken, ResultAvailable, null); } else { _mainWaitHandle.Set(); } } catch { _mainWaitHandle.Set(); throw; } }