Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/SIL.Harmony/DataModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,15 @@ public async Task<ObjectSnapshot> GetLatestSnapshotByObjectId(Guid entityId)
throw new ArgumentException($"unable to find snapshot for entity {entityId}");
}

public async IAsyncEnumerable<ObjectSnapshot> GetLatestSnapshots()
{
await using var repo = await _crdtRepositoryFactory.CreateRepository();
await foreach (var snapshot in repo.CurrentSnapshots().AsAsyncEnumerable())
{
yield return snapshot;
}
}

public async Task<T?> GetLatest<T>(Guid objectId) where T : class
{
return await _crdtRepositoryFactory.Execute(repo => repo.GetCurrent<T>(objectId));
Expand Down
Loading