/// <summary>
 /// Registers a global snapshot strategy which applies to all aggregate roots
 /// </summary>
 /// <param name="threshold">The version threshold on which a snapshot is taken</param>
 /// <returns>The event repository itself</returns>
 public EventStoreRepository WithGlobalSnapshotStrategy(int threshold)
 {
     this.globalSnapshotStrategy = new SnapshotStrategy(threshold);
     return(this);
 }
 /// <summary>
 /// Creates a new instance of <see cref="EventStoreRepository"/>
 /// </summary>
 /// <param name="eventStore">Dependency injection for <see cref="IEventStore"/></param>
 public EventStoreRepository(IEventStore eventStore)
 {
     this.eventStore = eventStore;
     this.typedSnapshotStrategies = new List <SnapshotStrategy>();
     this.globalSnapshotStrategy  = new SnapshotStrategy(100);
 }