public static FeedRangeIteratorCore Create( ContainerCore containerCore, FeedRangeInternal feedRangeInternal, string continuation, QueryRequestOptions options) { if (!string.IsNullOrEmpty(continuation)) { if (FeedRangeContinuation.TryParse(continuation, out FeedRangeContinuation feedRangeContinuation)) { return(new FeedRangeIteratorCore(containerCore, feedRangeContinuation, options)); } // Backward compatible with old format feedRangeInternal = FeedRangeEPK.ForCompleteRange(); feedRangeContinuation = new FeedRangeCompositeContinuation( string.Empty, feedRangeInternal, new List <Documents.Routing.Range <string> >() { new Documents.Routing.Range <string>( Documents.Routing.PartitionKeyInternal.MinimumInclusiveEffectivePartitionKey, Documents.Routing.PartitionKeyInternal.MaximumExclusiveEffectivePartitionKey, isMinInclusive: true, isMaxInclusive: false) }, continuation); return(new FeedRangeIteratorCore(containerCore, feedRangeContinuation, options)); } feedRangeInternal = feedRangeInternal ?? FeedRangeEPK.ForCompleteRange(); return(new FeedRangeIteratorCore(containerCore, feedRangeInternal, options)); }
public static ChangeFeedIteratorCore Create( ContainerInternal container, FeedRangeInternal feedRangeInternal, string continuation, ChangeFeedRequestOptions changeFeedRequestOptions) { if (!string.IsNullOrEmpty(continuation)) { if (FeedRangeContinuation.TryParse(continuation, out FeedRangeContinuation feedRangeContinuation)) { return(new ChangeFeedIteratorCore(container, feedRangeContinuation, changeFeedRequestOptions)); } else { throw new ArgumentException(string.Format(ClientResources.FeedToken_UnknownFormat, continuation)); } } feedRangeInternal = feedRangeInternal ?? FeedRangeEPK.ForCompleteRange(); return(new ChangeFeedIteratorCore(container, feedRangeInternal, changeFeedRequestOptions)); }