public EventProvider(EventProviderIdentity identity, IDomainEventCollection domainEventCollection)
     : this(identity,
            new AggregateRootType(domainEventCollection.AggregateRoot.GetType()),
            domainEventCollection.AggregateRoot.Identity)
 {
     Contract.Requires(identity != null);
     Contract.Requires(domainEventCollection?.AggregateRoot?.Identity != null);
 }
        public EventStreamStateTracker(IEventStream eventStream,
                                       IGuidGenerator guidGenerator,
                                       IDomainEventCollection domainEvents)
        {
            Contract.Requires(eventStream != null);
            Contract.Requires(guidGenerator != null);
            Contract.Requires(domainEvents != null);

            EventStream    = eventStream;
            _guidGenerator = guidGenerator;

            Apply(domainEvents);
        }