Beispiel #1
0
        private IList <T> ExecuteSegmented(bool firstOrDefaultMode)
        {
            _result = new List <T>();

            if (firstOrDefaultMode)
            {
                _query.BeginExecuteSegmented(ResultAvailable_FirstOrDefault, null);
            }
            else
            {
                _query.BeginExecuteSegmented(ResultAvailable, null);
            }

            _mainWaitHandle = new ManualResetEvent(false);
            _mainWaitHandle.WaitOne();

            return(_result);
        }
Beispiel #2
0
        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);
            }
        }