コード例 #1
0
        public EventProvider(EventProviderIdentity identity,
                             AggregateRootType type,
                             AggregateRootIdentity aggregateRootIdentity)
        {
            Contract.Requires(type != null);
            Contract.Requires(aggregateRootIdentity != null);
            Contract.Requires(identity != null);

            Identity              = identity;
            AggregateRootType     = type;
            AggregateRootIdentity = aggregateRootIdentity;
        }
コード例 #2
0
        public ICollection <EventProviderTransactionCollection> GetTransactions <TAggregateRoot>(int eventProvidersToSkip, int eventProvidersToTake) where TAggregateRoot : class, IAggregateRoot
        {
            try
            {
                // create new event provider type
                var eventProviderType = new AggregateRootType(typeof(TAggregateRoot));

                // get transactions
                var transactions = GetTransactions(eventProviderType, eventProvidersToSkip, eventProvidersToTake);
                Contract.Assume(transactions != null);

                // return transactions
                return(transactions);
            }
            catch (Exception ex)
            {
                throw new EventStoreException(ErrorGettingTransactionCollections, ex);
            }
        }
コード例 #3
0
        public IEventStream GetEventStream <TAggregateRoot>(AggregateRootIdentity identity) where TAggregateRoot : class, IAggregateRoot
        {
            try
            {
                // create new event provider type
                var eventProviderType = new AggregateRootType(typeof(TAggregateRoot));

                // get event stream
                var eventStream = GetEventStream(eventProviderType, identity);
                Contract.Assume(eventStream != null);

                // return event stream
                return(eventStream);
            }
            catch (Exception ex)
            {
                throw new EventStoreException(ErrorGettingEventStream, ex);
            }
        }
コード例 #4
0
 protected abstract Task <ICollection <EventProviderTransactionCollection> > GetTransactionsAsync(AggregateRootType eventProviderType, int eventProvidersToSkip, int eventProvidersToTake);
コード例 #5
0
 protected abstract Task <EventStream> GetEventStreamAsync(AggregateRootType eventProviderType, AggregateRootIdentity aggregateRootIdentity);
コード例 #6
0
 protected abstract EventStream GetEventStream(AggregateRootType eventProviderType, AggregateRootIdentity aggregateRootIdentity);