예제 #1
0
        protected EventStreamRevision(EventStreamRevisionIdentity identity, EventProviderVersion version)
        {
            Contract.Requires(identity != null);
            Contract.Requires(version != null);

            _identity = identity;
            _version  = version;
        }
예제 #2
0
        public DomainEventRevision(EventStreamRevisionIdentity identity, EventProviderVersion version, IReadOnlyCollection <IDomainEvent> domainEvents)
            : base(identity, version)
        {
            Contract.Requires(identity != null);
            Contract.Requires(version != null);
            Contract.Requires(domainEvents != null);

            _domainEvents = domainEvents;
        }
예제 #3
0
 public DomainEventRevision(EventStreamRevisionIdentity identity, EventProviderVersion version, IDomainEvent domainEvent)
     : this(identity, version, new Collection <IDomainEvent> {
     domainEvent
 })
 {
     Contract.Requires(identity != null);
     Contract.Requires(version != null);
     Contract.Requires(domainEvent != null);
 }
        private EventStream(IEventProvider eventProvider, IEnumerable <EventStreamRevision> revisions)
        {
            Contract.Requires(eventProvider != null);
            Contract.Requires(revisions != null);

            EventProvider = eventProvider;
            _revisions.AddRange(revisions);

            LatestVersion = GetLatestVersion();
        }
        public EventProviderStateTracker(IEventProvider eventProvider,
                                         EventProviderVersion latestVersion,
                                         IGuidGenerator guidGenerator)
        {
            Contract.Requires(eventProvider != null);
            Contract.Requires(latestVersion != null);
            Contract.Requires(guidGenerator != null);

            EventProvider  = eventProvider;
            LatestVersion  = latestVersion;
            _guidGenerator = guidGenerator;
        }
 public EventProviderVersion GetNextVersion()
 {
     return(LatestVersion = LatestVersion.Increment());
 }