Interface IForgottenTenantStore
- Namespace
- Stratara.Projections.Abstractions
- Assembly
- Stratara.Projections.dll
Keeps, for each projection that declares IForgetsDeletedTenants, the tenants it has seen deleted. The record is derived from the facts the projection applied and is emptied with its read model.
public interface IForgottenTenantStore
- Extension Methods
Remarks
A projection is identified by the name the projection handler gives it, which is also the name its
checkpoints and a rebuild use. The read store's implementation is registered by
AddNpgsqlReadDbContextFactory, or by AddStrataraForgottenTenants for a read context
registered another way.
Methods
ClearAsync(string, CancellationToken)
Empties the record of one projection, as its read model is emptied for a replay or a rebuild.
Task ClearAsync(string projection, CancellationToken cancellationToken = default)
Parameters
projectionstringThe projection's name.
cancellationTokenCancellationTokenPropagated to the store.
Returns
- Task
A task that completes when the projection's record is empty.
ForgetAsync(string, IReadOnlyCollection<Guid>, CancellationToken)
Records that projection has seen tenantIds deleted.
Task ForgetAsync(string projection, IReadOnlyCollection<Guid> tenantIds, CancellationToken cancellationToken = default)
Parameters
projectionstringThe projection's name.
tenantIdsIReadOnlyCollection<Guid>The deleted tenants. A tenant already recorded for the projection is left as it is.
cancellationTokenCancellationTokenPropagated to the store.
Returns
- Task
A task that completes when every tenant is recorded.
HasForgottenAsync(string, Guid, CancellationToken)
Whether projection has seen tenantId deleted.
Task<bool> HasForgottenAsync(string projection, Guid tenantId, CancellationToken cancellationToken = default)
Parameters
projectionstringThe projection's name.
tenantIdGuidThe tenant.
cancellationTokenCancellationTokenPropagated to the store.