Docs
Tenantry CoreAPI reference

SaveWithoutTransactionBehavior enum

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

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. Without a transaction, a statement EF Core sends beside a check that fails would stay written. Set with EfCoreIsolationOptions.OnSaveWithoutTransaction.

public enum SaveWithoutTransactionBehavior

Values

ValueDescription
UseTransaction = 0Run that save in a transaction EF Core begins and commits itself, as it does by default (AutoTransactionBehavior.WhenNeeded), and set Never back when the save ends. Other saves stay without one. The default.
Reject = 1Throw TenantIsolationViolationException, of kind TenantIsolationViolationKind.SaveWithoutTransaction, before anything is sent. For a database or connection pooler that cannot run transactions.

On this page