예제 #1
0
        /// <summary>
        /// Prepares the event for writing to an event log.
        /// </summary>
        internal DurableEvent Prepare(string logId, long sequenceNr, DateTime timestamp)
        {
            var id = ProcessId == UndefinedLogId ? logId : ProcessId;
            var vt = ProcessId == UndefinedLogId?VectorTimestamp.SetLocalTime(logId, sequenceNr) : VectorTimestamp;

            return(new DurableEvent(Payload, systemTimestamp: timestamp, vectorTimestamp: vt, processId: id, localLogId: logId, localSequenceNr: sequenceNr));
        }
예제 #2
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (Payload != null ? Payload.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (EmitterId != null ? EmitterId.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (EmitterAggregateId != null ? EmitterAggregateId.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ SystemTimestamp.GetHashCode();
         hashCode = (hashCode * 397) ^ (VectorTimestamp != null ? VectorTimestamp.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ProcessId != null ? ProcessId.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (LocalLogId != null ? LocalLogId.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ LocalSequenceNr.GetHashCode();
         hashCode = (hashCode * 397) ^ (DeliveryId != null ? DeliveryId.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ PersistOnEventSequenceNr.GetHashCode();
         hashCode = (hashCode * 397) ^ PersistOnEventId.GetHashCode();
         hashCode = (hashCode * 397) ^ Id.GetHashCode();
         foreach (var id in CustomDestinationAggregateIds)
         {
             hashCode = (hashCode * 397) ^ id.GetHashCode();
         }
         return(hashCode);
     }
 }