/// <summary> /// Initializes a new instance of the <see cref="CommittedEventEnvelope"/> class. /// </summary> /// <param name="commitSequence">The <see cref="CommitSequenceNumber"/>.</param> /// <param name="metadata">The <see cref="EventMetadata"/>.</param> /// <param name="event">The event as <see cref="PropertyBag"/>.</param> public CommittedEventEnvelope( CommitSequenceNumber commitSequence, EventMetadata metadata, PropertyBag @event) { Metadata = metadata; Event = @event; Version = metadata.VersionedEventSource.ToCommittedEventVersion(commitSequence); }
/// <summary> /// Instantiates a new instance of a <see cref="CommittedEventStream" /> /// </summary> /// <param name="sequence">The <see cref="CommitSequenceNumber" /> for this committed event stream</param> /// <param name="source">The <see cref="VersionedEventSource" /> that this stream applies to</param> /// <param name="id">The unique id in the form of a <see cref="CommitId" /></param> /// <param name="correlationId">A <see cref="CorrelationId" /> used to relate this event stream to other actions in the system</param> /// <param name="timestamp">A timestamp in the form of a <see cref="DateTimeOffset" /> representing when the stream was committed</param> /// <param name="events">An enumerable of <see cref="EventEnvelope" /> representing the events that are committed in this commit</param> public CommittedEventStream(CommitSequenceNumber sequence, VersionedEventSource source, CommitId id, CorrelationId correlationId, DateTimeOffset timestamp, EventStream events) { Sequence = sequence; Source = source; Id = id; Timestamp = timestamp; CorrelationId = correlationId; Events = events; LastEventVersion = source.ToCommittedEventVersion(sequence); }