Skip to content

Commit 31d0dfd

Browse files
authored
Merge pull request #87 from tgiachi/docs/entity-store-di-warning
docs(persistence): warn against resolving IEntityStore from the DI container
2 parents 16c441a + 04b522d commit 31d0dfd

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)