Platform.StreamStorage.Azure.AzureEventStore.ReadAll C# (CSharp) Method

ReadAll() public method

public ReadAll ( EventStoreOffset startOffset, int maxRecordCount ) : IEnumerable
startOffset Platform.StreamClients.EventStoreOffset
maxRecordCount int
return IEnumerable
        public IEnumerable<RetrievedEventsWithMetaData> ReadAll(EventStoreOffset startOffset, int maxRecordCount)
        {
            Ensure.Nonnegative(maxRecordCount, "maxRecordCount");

            var maxOffset = _checkpoint.Read();

            // nothing to read from here
            if (startOffset >= new EventStoreOffset(maxOffset))
                yield break;

            int recordCount = 0;
            foreach (var msg in _store.ReadAll(startOffset.OffsetInBytes, maxOffset, maxRecordCount))
            {
                yield return msg;
                if (++recordCount >= maxRecordCount)
                    yield break;
                // we don't want to go above the initial water mark
                if (msg.Next.OffsetInBytes >= maxOffset)
                    yield break;

            }
        }