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 MissingTenantBehaviorValues
| Value | Description |
|---|---|
Reject = 0 | Throw TenantNotResolvedException before anything is written. The default. |
Warn = 1 | As 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 = 2 | Save 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. |
ITenantModelContributor interface
Adds to the model of every DbContext that uses UseTenantry.
SaveWithoutTransactionBehavior enum
What SaveChanges does, with Database.AutoTransactionBehavior set to Never and no transaction, when the tenant check of some rows it writes is another of its statements: owned rows in a table of their own, checked by their owner's statement, and the rows of an entity mapped to more than one table table-per-type, entity splitting, checked in the table with TenantId.