Example #1
0
        public async Task <ReadStreamPage> ReadStreamForwards(
            StreamId streamId,
            int fromVersionInclusive,
            int maxCount,
            bool prefetchJsonData = true,
            CancellationToken cancellationToken = default)
        {
            var client = CreateClient();

            client = await client.RootAsync(
                LinkFormatter.ReadStreamForwards(streamId, fromVersionInclusive, maxCount, prefetchJsonData),
                cancellationToken);

            return(ReadStreamForwardsInternal(
                       client,
                       streamId,
                       fromVersionInclusive,
                       prefetchJsonData));
        }
        public async Task <ReadStreamPage> ReadStreamForwards(
            StreamId streamId,
            int fromVersionInclusive,
            int maxCount,
            bool prefetchJsonData = true,
            CancellationToken cancellationToken = default)
        {
            Ensure.That(fromVersionInclusive, nameof(fromVersionInclusive)).IsGte(0);
            Ensure.That(maxCount, nameof(maxCount)).IsGte(1);

            GuardAgainstDisposed();

            var client = CreateClient();

            client = await client.RootAsync(
                LinkFormatter.ReadStreamForwards(streamId, fromVersionInclusive, maxCount, prefetchJsonData),
                cancellationToken);

            return(ReadStreamForwardsInternal(
                       client,
                       streamId,
                       fromVersionInclusive,
                       prefetchJsonData));
        }