/// <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="IApplicationResourceIdentifier"/> representing the <see cref="IEvent"/></param> /// <param name="eventSourceId"><see cref="EventSourceId"/> for the <see cref="IEventSource"/></param> /// <param name="eventSource"><see cref="IApplicationResourceIdentifier"/> 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, IApplicationResourceIdentifier @event, EventSourceId eventSourceId, IApplicationResourceIdentifier 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; }
/// <summary> /// Initializes a new instance of <see cref="EventProcessorState"/> /// </summary> /// <param name="eventProcessor"><see cref="IEventProcessor"/> the state is for</param> /// <param name="status"><see cref="EventProcessorStatus">Status</see> of the <see cref="IEventProcessor"/></param> /// <param name="lastProcessed">When processed last</param> /// <param name="lastProcessedSequenceNumber">Last <see cref="EventSequenceNumber"/></param> /// <param name="lastProcessedSequenceNumberForEventType">Last <see cref="EventSequenceNumber"/> for the <see cref="IEvent">event type</see></param> /// <param name="lastProcessingStatus"><see cref="EventProcessingStatus"/> of the processing</param> public EventProcessorState( IEventProcessor eventProcessor, EventProcessorStatus status, DateTimeOffset lastProcessed, EventSequenceNumber lastProcessedSequenceNumber, EventSequenceNumber lastProcessedSequenceNumberForEventType, EventProcessingStatus lastProcessingStatus) { Status = status; EventProcessor = eventProcessor; LastProcessed = lastProcessed; LastProcessedSequenceNumber = lastProcessedSequenceNumber; LastProcessedSequenceNumberForEventType = lastProcessedSequenceNumberForEventType; LastProcessingStatus = lastProcessingStatus; }
/// <inheritdoc/> public IEventEnvelope WithSequenceNumberForEventType(EventSequenceNumber sequenceNumberForEventType) { return(new EventEnvelope(CorrelationId, EventId, SequenceNumber, sequenceNumberForEventType, Generation, Event, EventSourceId, EventSource, Version, CausedBy, Occurred)); }