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; }
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); } }
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); } }
protected abstract Task <ICollection <EventProviderTransactionCollection> > GetTransactionsAsync(AggregateRootType eventProviderType, int eventProvidersToSkip, int eventProvidersToTake);
protected abstract Task <EventStream> GetEventStreamAsync(AggregateRootType eventProviderType, AggregateRootIdentity aggregateRootIdentity);
protected abstract EventStream GetEventStream(AggregateRootType eventProviderType, AggregateRootIdentity aggregateRootIdentity);