public BatchID(DateTime timestamp) { EventID.ValidateTimestamp(timestamp); Timestamp = EventID.GetTimestampDate(timestamp); Sequence = 1; }
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); }