public static IEnumerable <HFile> EnumerateFiles(this ISnapshotRepository snapshotRepository, SnapshotLocation snapshotLocation, BlackList blackList = null) { Snapshot snapshot = snapshotRepository.GetSnapshot(snapshotLocation); return(snapshot == null ? Enumerable.Empty <HFile>() : snapshot.EnumerateFiles(snapshotLocation.InternalPath, blackList)); }
public T Get(Guid id) { T eventSourced = this.CreateEventSourcedInstance(); IEnumerable <IDomainEvent> domainEvents; if (this.snapshotRepo.HasSnapshot(id)) { ISnapshot snapshot = snapshotRepo.GetSnapshot(id); eventSourced.LoadFromSnapshot(snapshot); var eventsAfterSnapshot = this.domainEventRepo.LoadEvents(id, snapshot.Version); domainEvents = eventsAfterSnapshot; } else { domainEvents = domainEventRepo.LoadEvents(id); } eventSourced.LoadFromHistory(domainEvents); return(eventSourced); }
public async Task <TSnapshot> GetSnapshot <TSnapshot>(Guid snapshotId) where TSnapshot : IProjection { return(await _repository.GetSnapshot <TSnapshot>(snapshotId)); }