Beispiel #1
0
        public override async ValueTask <Page <PageBlobRange> > GetNextPageAsync(
            string continuationToken,
            int?pageSizeHint,
            bool async,
            CancellationToken cancellationToken)
        {
            // We are calling GetPageRangeDiff
            if (_diff)
            {
                ResponseWithHeaders <PageList, PageBlobGetPageRangesDiffHeaders> response;
                if (async)
                {
                    response = await _client.GetPageRangesDiffPageableInternal(
                        marker : continuationToken,
                        pageSizeHint : pageSizeHint,
                        range : _range,
                        snapshot : _snapshot,
                        previousSnapshot : _previousSnapshot,
                        previousSnapshotUri : _previousSnapshotUri,
                        conditions : _requestConditions,
                        async : true,
                        operationName : _operationName,
                        cancellationToken : cancellationToken)
                               .ConfigureAwait(false);
                }
                else
                {
                    response = _client.GetPageRangesDiffPageableInternal(
                        marker: continuationToken,
                        pageSizeHint: pageSizeHint,
                        range: _range,
                        snapshot: _snapshot,
                        previousSnapshot: _previousSnapshot,
                        previousSnapshotUri: _previousSnapshotUri,
                        conditions: _requestConditions,
                        async: false,
                        operationName: _operationName,
                        cancellationToken: cancellationToken)
                               .EnsureCompleted();
                }

                return(Page <PageBlobRange> .FromValues(
                           values : response.ToPageBlobRanges(),
                           continuationToken : response.Value.NextMarker,
                           response : response.GetRawResponse()));
            }

            // We are calling GetPageRange
            else
            {
                ResponseWithHeaders <PageList, PageBlobGetPageRangesHeaders> response;
                if (async)
                {
                    response = await _client.GetPageRangesPageableInteral(
                        marker : continuationToken,
                        pageSizeHint : pageSizeHint,
                        range : _range,
                        snapshot : _snapshot,
                        conditions : _requestConditions,
                        async : true,
                        cancellationToken : cancellationToken)
                               .ConfigureAwait(false);
                }
                else
                {
                    response = _client.GetPageRangesPageableInteral(
                        marker: continuationToken,
                        pageSizeHint: pageSizeHint,
                        range: _range,
                        snapshot: _snapshot,
                        conditions: _requestConditions,
                        async: false,
                        cancellationToken: cancellationToken)
                               .EnsureCompleted();
                }

                return(Page <PageBlobRange> .FromValues(
                           values : response.ToPageBlobRanges(),
                           continuationToken : response.Value.NextMarker,
                           response : response.GetRawResponse()));
            }
        }