Docs
Tenantry CoreAPI reference

MissingTenantBehavior enum

Namespace: Tenantry.Core · Package: Tenantry.Core · API reference

Policy for what happens when a tenant-scoped operation runs without a resolved tenant context. Shared across EF Core write isolation and background-job tenant propagation so the behaviour is configured with a single vocabulary.

public enum MissingTenantBehavior

Values

ValueDescription
Allow = 0Proceed without a tenant, silently. EF Core writes are saved without a stamped TenantId; a background job runs without a tenant scope.
Warn = 1Proceed without a tenant, but log a structured warning. The default — surfaces endpoints, jobs, or middleware ordering that bypassed tenant resolution without failing the operation.
Reject = 2Fail the operation. EF Core writes throw TenantNotResolvedException before anything is persisted; a background job throws and is left to the host's retry/error handling.
Skip = 3Abandon the operation without raising an error. Intended for background-job propagation, where it means "acknowledge and drop the message/job without running the handler". For EF Core write isolation there is nothing to abandon, so this behaves like MissingTenantBehavior.Allow (the save proceeds without a stamped tenant).

On this page