Skip to content

Commit 04b522d

Browse files
committed
docs(persistence): warn against resolving IEntityStore from the DI container
The store is intentionally never registered in the container and its implementation has an internal constructor, so direct registration or resolution fails at runtime; the remarks now point callers to RegisterPersistedEntity plus IPersistenceService.GetStore.
1 parent 16c441a commit 04b522d

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

  • src/SquidStd.Persistence.Abstractions/Interfaces/Persistence

src/SquidStd.Persistence.Abstractions/Interfaces/Persistence/IEntityStore.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ namespace SquidStd.Persistence.Abstractions.Interfaces.Persistence;
55
/// and return detached clones; writes append to the journal then apply to memory. Reads are available
66
/// in both synchronous and asynchronous forms; the async overloads delegate to the synchronous ones.
77
/// </summary>
8+
/// <remarks>
9+
/// WARNING: do not register or resolve <see cref="IEntityStore{TEntity,TKey}" /> directly in the DI
10+
/// container - it is intentionally never registered there, and its implementation cannot be constructed
11+
/// by the container. Register the entity with <c>RegisterPersistedEntity</c> and obtain the store from
12+
/// <see cref="IPersistenceService.GetStore{TEntity,TKey}" /> instead.
13+
/// </remarks>
814
public interface IEntityStore<TEntity, in TKey>
915
{
1016
/// <summary>Completes synchronously from memory. Returns the number of entities of this type currently held.</summary>

0 commit comments

Comments
 (0)