Multi-tenancy in EF Core: no tenant means no rows
The author shows a multi-tenancy pattern for ASP.NET Core and EF Core that uses global query filters so each request only sees its own tenant's rows. When no tenant is set, filtered queries return nothing, which fails closed. The post also covers tenant-scoped unique indexes, limiting IgnoreQueryFilters(), and an integration test that checks cross-tenant access. It is a practical starting point for SaaS backends.