/// <summary>
 /// Construct a new event entry from a published domain event message to enable storing the event or sending it to a
 /// remote location.
 /// <p>
 /// The given {@code serializer} will be used to serialize the payload and metadata in the given {@code eventMessage}.
 /// The type of the serialized data will be the same as the given {@code contentType}.
 /// </summary>
 /// <param name="eventMessage">The event message to convert to a serialized event entry</param>
 /// <param name="serializer">The serializer to convert the event</param>
 /// <param name="contentType">The data type of the payload and metadata after serialization</param>
 public AbstractDomainEventEntry(IDomainEventMessage <T> eventMessage, ISerializer serializer, Type contentType)
     : base(eventMessage, serializer, contentType)
 {
     _type = eventMessage.Type();
     _aggregateIdentifier = eventMessage.GetAggregateIdentifier();
     _sequenceNumber      = eventMessage.GetSequenceNumber();
 }
Пример #2
0
 /// <summary>
 /// Initialize a DomainEventMessage originating from an aggregate.
 /// </summary>
 /// <param name="trackingToken">Tracking token of the event</param>
 /// <param name="delegate">Delegate domain event containing other event data</param>
 public GenericTrackedDomainEventMessage(
     ITrackingToken trackingToken,
     IDomainEventMessage <T> @delegate
     ) : this(
         trackingToken,
         @delegate.Type(),
         @delegate.GetAggregateIdentifier(),
         @delegate.GetSequenceNumber(),
         @delegate,
         @delegate.GetTimestamp()
         )
 {
 }