Docs
Tenantry CoreAPI reference

MissingTenantBehavior enum

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

What SaveChanges does when it writes tenant-owned entities and no tenant is current. Set with EfCoreIsolationOptions.OnMissingTenant. Reads are not affected: they always fail closed.

public enum MissingTenantBehavior

Values

ValueDescription
Reject = 0Throw TenantNotResolvedException before anything is written. The default.
Warn = 1As MissingTenantBehavior.Allow, but log a structured warning. Surfaces code that writes without a tenant, such as an endpoint or job that bypassed tenant resolution, without failing it.
Allow = 2Save without a tenant, silently. Updates and deletes are then not checked against a tenant, and a new entity is saved only if its TenantId is set. For maintenance code that deliberately writes across tenants.

On this page