Ejemplo n.º 1
0
        /// <inheritdoc/>
        public EventSourceVersion GetFor(IApplicationResourceIdentifier eventSource, EventSourceId eventSourceId)
        {
            var version = EventSourceVersion.Zero;

            version = _eventStore.GetVersionFor(eventSource, eventSourceId);
            return(version);
        }
Ejemplo n.º 2
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="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;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of <see cref="CommittedEventStream">CommittedEventStream</see>
 /// </summary>
 /// <param name="eventSourceId">The <see cref="EventSourceId"/> of the <see cref="IEventSource"/></param>
 /// <param name="eventsWithEnvelope">The <see cref="IEvent">events</see> with their <see cref="EventEnvelope">envelopes</see></param>
 public CommittedEventStream(EventSourceId eventSourceId, IEnumerable <EventAndEnvelope> eventsWithEnvelope)
 {
     EventSourceId = eventSourceId;
     foreach (var eventAndEnvelope in eventsWithEnvelope)
     {
         EnsureEventIsValid(eventAndEnvelope);
         _events.Add(eventAndEnvelope);
     }
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of <see cref="EventBelongsToOtherEventSource"/>
 /// </summary>
 /// <param name="eventEventSourceId"><see cref="EventSourceId"/> for the event</param>
 /// <param name="otherEventSourceId"><see cref="EventSourceId"/> for the other <see cref="IEventSource"/></param>
 public EventBelongsToOtherEventSource(EventSourceId eventEventSourceId, EventSourceId otherEventSourceId) : base($"EventSource '{eventEventSourceId}' from event mismatches with '{otherEventSourceId}'. Hint: You might be trying append an event to an UncommittedEventStream belonging to a different EventSource")
 {
 }
Ejemplo n.º 5
0
 /// <inheritdoc/>
 public EventSourceVersion GetVersionFor(IApplicationResourceIdentifier eventSource, EventSourceId eventSourceId)
 {
     return(EventSourceVersion.Zero);
 }
Ejemplo n.º 6
0
 /// <inheritdoc/>
 public bool HasEventsFor(IApplicationResourceIdentifier eventSource, EventSourceId eventSourceId)
 {
     return(false);
 }
Ejemplo n.º 7
0
 /// <inheritdoc/>
 public IEnumerable <EventAndEnvelope> GetFor(IApplicationResourceIdentifier eventSource, EventSourceId eventSourceId)
 {
     return(new EventAndEnvelope[0]);
 }
Ejemplo n.º 8
0
 /// <inheritdoc/>
 public void SetFor(IApplicationResourceIdentifier eventSource, EventSourceId eventSourceId, EventSourceVersion version)
 {
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Initializes an instance of <see cref="EventSource">EventSource</see>
 /// </summary>
 /// <param name="id"><see cref="Events.EventSourceId"/> of the event source</param>
 protected EventSource(EventSourceId id)
 {
     EventSourceId     = id;
     UncommittedEvents = new UncommittedEventStream(this);
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Initializes a new instance of <see cref="CommittedEventStream">CommittedEventStream</see>
 /// </summary>
 /// <param name="eventSourceId">The <see cref="EventSourceId"/> of the <see cref="IEventSource"/></param>
 public CommittedEventStream(EventSourceId eventSourceId)
 {
     EventSourceId = eventSourceId;
 }
Ejemplo n.º 11
0
 /// <summary>
 /// Initializes a new instance of <see cref="Event">Event</see>
 /// </summary>
 protected Event(EventSourceId eventSourceId)
 {
     EventSourceId = eventSourceId;
 }