Tenantry CoreAPI reference
ITenantActivityValidator<TKey> interface
Namespace: Tenantry · Package: Tenantry.Core · API reference
Decides whether a tenant may have work run for it: requests, background work, jobs and messages. Return false for a suspended tenant, so suspending it stops all its work.
Register one with tenant.ValidateTenantActivity(…), or as a singleton ITenantActivityValidator<TKey>. Every registered validator must allow a tenant. ITenantActivity<TKey> asks them. It is a singleton, so a validator must not depend on scoped services; read what it needs from the tenant, which the store returns.
public interface ITenantActivityValidator<TKey> where TKey : IEquatable<TKey>, IParsable<TKey>Type parameters
TKey: The tenant identifier type.
Methods
IsActiveAsync(ITenantDescriptor<TKey>, CancellationToken)
Returns true when work may run for tenant.
ValueTask<bool> IsActiveAsync(ITenantDescriptor<TKey> tenant, CancellationToken cancellationToken)Parameters:
tenantITenantDescriptor<TKey>: The tenant, as the store returned it.cancellationTokenCancellationToken: Cancels the check.
Returns: ValueTask<bool>