In multi-tenant SaaS environments, tenant data isolation is an immutable security invariant.
BitzOrcas.Modern enforces Ambient Context propagation + compile-time dual ORM Global Query Filters, injecting WHERE TenantId = @tenantId automatically during SQL generation.
8-Step Tenant Resolution Hierarchy
Dual ORM Compile-Time Global Tenant Isolation
For all aggregate roots inheriting from TenantAggregateRoot and decorated with [BitzTable], dual ORM adapters automatically register global tenant query filters:
// Developer-authored high-level query / read store call:var matters = await noteReadStore.SearchAsync(fields, paging, sort, cancellationToken);
// SQL generated under the hood by EF Core and SqlSugar (automatically appending tenant scoping):// SELECT * FROM LegalMatterIntake// WHERE Status = 2 AND TenantId = 'lawfirm-alpha';[!IMPORTANT] Zero Cognitive Overhead: Developers do not need to manually set
TenantIdor appendWHERE TenantId = ...clauses when authoring queries or inserting records. The pipeline and persistence adapters inject tenant scopes automatically, physically eliminating cross-tenant Insecure Direct Object Reference (IDOR) vulnerabilities.
Summary
Automatic SQL injection of TenantId guards against Insecure Direct Object References (IDOR) without developer boilerplate.