Interface ITenantScopingCapability<TContract>
Registration-time capability marker declaring that a persistence store contract
(TContract) has been wired by a provider that honors the ambient
tenant discriminator on every operation.
public interface ITenantScopingCapability<TContract>
Type Parameters
TContractThe store contract the capability applies to (for example, an event store, saga store, or the projection-store family). For the generic projection-store family the type argument is a family discriminator (a single closed marker such as the projection-store contract closed over object), not the shape of any individual store.
- Extension Methods
Remarks
This marker exists so that row-discriminator multi-tenancy can fail closed at registration when a tenant-unaware provider store is present. The tenant-scoping decorators are applied through factory registrations and telemetry wrappers, so the wrapped store's implementation type cannot be inspected reliably; the presence of this marker in the service collection is the authoritative, registration-time signal that the wrapped store actually enforces the tenant predicate.
Providers that thread the ambient tenant through their store implementation register this marker
through the dep-gated seams on TenantScopedStoreServiceCollectionExtensions
(AddTenantAwareStore / AddTenantScopedProjectionStore), co-located with the store
registration. AddTenantAwareStore derives the choice of this marker versus
ITenantPartitionedCapability<TContract> from the store's own constructor shape, so a
provider never names which mechanism applies — a provider that does not honor the tenant discriminator
simply has a constructor with no ITenantContext parameter, causing row-discriminator
wiring to reject the configuration rather than silently returning cross-tenant data.
Structural lock. The Excalibur.Dispatch.ITenantScopingCapability<TContract>.AssertWiredThroughDepGatedSeam() member is
internal, so this interface can only be implemented from within
Excalibur.Dispatch.Abstractions (and its InternalsVisibleTo friends). Its sole
implementation is the internal TenantScopingCapabilityMarker<TContract>, emitted only by
the dep-gated seams above. A provider assembly outside the friend set therefore cannot
register a cloned bare marker beside a store built without ITenantContext — the clone
fails to compile. This makes the "marker without the tenant dependency it attests" leak
(a truthful-looking capability on a cross-tenant-leaking store) structurally inexpressible for those
providers, rather than merely discouraged.