Data Isolation per Module: Schema per Module with EF Core and Cross-Module Queries
Each module puts its tables into its own schema with HasDefaultSchema in its own DbContext, keeps its migration history in its own schema with MigrationsHistoryTable, and runs in the database as a user authorised only on its own schema. On SQL Server we show Ordering's user being refused a join to a Catalog table with error 229, and produce the same report without breaching isolation through contract calls, an event-fed read model and reporting views published by the modules.
7 Nov 2026
·
10 min
·
6