Marten.Events.Projections.Async.EventPage.LastEncountered C# (CSharp) Method

LastEncountered() public method

public LastEncountered ( ) : long
return long
        public long LastEncountered()
        {
            var candidate = NextKnownSequence > 0 ? NextKnownSequence - 1 : LastKnownSequence;

            if (candidate > 0) return candidate;

            if (Sequences.Any()) return Sequences.Last();

            return From;
        }

Usage Example

Example #1
0
        public void last_encountered_with_no_known_sequence()
        {
            var page = new EventPage(0, 100, new List<IEvent>())
            {
                NextKnownSequence = 0,
                LastKnownSequence = 1000
            };

            page.LastEncountered().ShouldBe(1000);
        }
All Usage Examples Of Marten.Events.Projections.Async.EventPage::LastEncountered