diff --git a/src/SIL.Harmony/DataModel.cs b/src/SIL.Harmony/DataModel.cs index 9235389..869d4eb 100644 --- a/src/SIL.Harmony/DataModel.cs +++ b/src/SIL.Harmony/DataModel.cs @@ -251,6 +251,15 @@ public async Task GetLatestSnapshotByObjectId(Guid entityId) throw new ArgumentException($"unable to find snapshot for entity {entityId}"); } + public async IAsyncEnumerable GetLatestSnapshots() + { + await using var repo = await _crdtRepositoryFactory.CreateRepository(); + await foreach (var snapshot in repo.CurrentSnapshots().AsAsyncEnumerable()) + { + yield return snapshot; + } + } + public async Task GetLatest(Guid objectId) where T : class { return await _crdtRepositoryFactory.Execute(repo => repo.GetCurrent(objectId));