示例#1
0
 /// <summary>
 /// Initializes a new instance of <see cref="EventEnvelope"/>
 /// </summary>
 /// <param name="correlationId"><see cref="TransactionCorrelationId"/> the <see cref="IEvent"/> is part of</param>
 /// <param name="eventId"><see cref="EventId"/> for the <see cref="IEvent"/></param>
 /// <param name="sequenceNumber"></param>
 /// <param name="sequenceNumberForEventType"></param>
 /// <param name="generation"><see cref="EventGeneration"/> for the <see cref="IEvent"/> </param>
 /// <param name="event"><see cref="Artifact"/> representing the <see cref="IEvent"/></param>
 /// <param name="eventSourceId"><see cref="EventSourceId"/> for the <see cref="IEventSource"/></param>
 /// <param name="eventSource"><see cref="Artifact"/> representing the <see cref="IEventSource"/></param>
 /// <param name="version"><see cref="EventSourceVersion">Version</see> of the event related to the <see cref="IEventSource"/></param>
 /// <param name="causedBy"><see cref="string"/> representing which person or what system caused the event</param>
 /// <param name="occurred"><see cref="DateTime">When</see> the event occured</param>
 public EventEnvelope(
     TransactionCorrelationId correlationId,
     EventId eventId,
     EventSequenceNumber sequenceNumber,
     EventSequenceNumber sequenceNumberForEventType,
     EventGeneration generation,
     Artifact @event,
     EventSourceId eventSourceId,
     Artifact eventSource,
     EventSourceVersion version,
     CausedBy causedBy,
     DateTimeOffset occurred)
 {
     CorrelationId              = correlationId;
     EventId                    = eventId;
     SequenceNumber             = sequenceNumber;
     SequenceNumberForEventType = sequenceNumberForEventType;
     Generation                 = generation;
     Event         = @event;
     EventSourceId = eventSourceId;
     EventSource   = eventSource;
     Version       = version;
     CausedBy      = causedBy;
     Occurred      = occurred;
 }
示例#2
0
 /// <inheritdoc/>
 public IEventEnvelope WithSequenceNumberForEventType(EventSequenceNumber sequenceNumberForEventType)
 {
     return(new EventEnvelope(CorrelationId, EventId, SequenceNumber, sequenceNumberForEventType, Generation, Event, EventSourceId, EventSource, Version, CausedBy, Occurred));
 }