Beispiel #1
0
        public BatchID(DateTime timestamp)
        {
            EventID.ValidateTimestamp(timestamp);

            Timestamp = EventID.GetTimestampDate(timestamp);
            Sequence  = 1;
        }
Beispiel #2
0
        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);
        }