コード例 #1
0
        /// <inheritdoc/>
        public EventSourceVersion GetFor(IApplicationResourceIdentifier eventSource, EventSourceId eventSourceId)
        {
            var version = EventSourceVersion.Zero;

            version = _eventStore.GetVersionFor(eventSource, eventSourceId);
            return(version);
        }
コード例 #2
0
ファイル: EventEnvelope.cs プロジェクト: svethors/DotNET.SDK
 /// <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;
 }
コード例 #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);
     }
 }
コード例 #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")
 {
 }
コード例 #5
0
ファイル: NullEventStore.cs プロジェクト: svethors/DotNET.SDK
 /// <inheritdoc/>
 public EventSourceVersion GetVersionFor(IApplicationResourceIdentifier eventSource, EventSourceId eventSourceId)
 {
     return(EventSourceVersion.Zero);
 }
コード例 #6
0
ファイル: NullEventStore.cs プロジェクト: svethors/DotNET.SDK
 /// <inheritdoc/>
 public bool HasEventsFor(IApplicationResourceIdentifier eventSource, EventSourceId eventSourceId)
 {
     return(false);
 }
コード例 #7
0
ファイル: NullEventStore.cs プロジェクト: svethors/DotNET.SDK
 /// <inheritdoc/>
 public IEnumerable <EventAndEnvelope> GetFor(IApplicationResourceIdentifier eventSource, EventSourceId eventSourceId)
 {
     return(new EventAndEnvelope[0]);
 }
コード例 #8
0
 /// <inheritdoc/>
 public void SetFor(IApplicationResourceIdentifier eventSource, EventSourceId eventSourceId, EventSourceVersion version)
 {
 }
コード例 #9
0
ファイル: EventSource.cs プロジェクト: svethors/DotNET.SDK
 /// <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);
 }
コード例 #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;
 }
コード例 #11
0
ファイル: Event.cs プロジェクト: svethors/DotNET.SDK
 /// <summary>
 /// Initializes a new instance of <see cref="Event">Event</see>
 /// </summary>
 protected Event(EventSourceId eventSourceId)
 {
     EventSourceId = eventSourceId;
 }