public bool TryToAdvance(DateTime timestamp) { Check.Requires <InvalidOperationException>(timestamp > Timestamp); timestamp = EventID.GetTimestampDate(timestamp); if (Timestamp == timestamp) { if (Sequence >= EventID.MaxBatchSequence) { return(false); } Sequence++; } else { this = new BatchID(timestamp); } return(true); }
public DefaultEventIDGenerator(EventID lastID, Clock clock) { _clock = Check.NotNull(clock, nameof(clock)); _currentBatchID = Check.NotNull(lastID, nameof(lastID)).BatchID; }