# .NET multi-tenancy: query isolation and SQL Server partitions — part 1/4

Canonical source : [.NET multi-tenancy: query isolation and SQL Server partitions — part 1/4](<https://sebastien.rigaux.be/en/tech-watch/links/net-multi-tenancy-query-isolation-and-sql-server-partitions-part-14>)

This first installment presents a shared-schema .NET multi-tenant design: EF Core filters reads by tenant, while SQL Server physically partitions rows to speed up data access. The key distinction is that partitioning is not a security boundary; isolation relies on the EF Core global query filter.

The article also explains resolving the tenant per request, assigning its ID to new rows, and adding partitions to migrations with raw SQL. The primary key must include `GuildId`, a constraint SQL Server imposes when partitioning a unique index.

- Selected on : 2026-11-02

- Resource publication : 2026-07-17

- Entry updated : 2026-11-07T20:32:37+0000

- Format : Article

- Source language : EN

- Credit : Barret

- Found via : [C\# Digest](<https://csharpdigest.net/>)

Original resource : [.NET multi-tenancy: query isolation and SQL Server partitions — part 1/4](<https://barretblake.dev/posts/development/2026/07/multi-tenant-part-1/>)

Tags : [Multi-tenancy](<https://sebastien.rigaux.be/en/tech-watch/tags/multi-tenancy>) · [.NET](<https://sebastien.rigaux.be/en/tech-watch/tags/dotnet>) · [Entity Framework Core](<https://sebastien.rigaux.be/en/tech-watch/tags/entity-framework-core>) · [SQL Server](<https://sebastien.rigaux.be/en/tech-watch/tags/sql-server>) · [Security](<https://sebastien.rigaux.be/en/tech-watch/tags/security>)

Available versions : [Français](<https://sebastien.rigaux.be/veille/liens/net-multi-tenant-requetes-isolees-et-partitions-sql-server-partie-14>) · [English](<https://sebastien.rigaux.be/en/tech-watch/links/net-multi-tenancy-query-isolation-and-sql-server-partitions-part-14>)

[Back to tech watch](<https://sebastien.rigaux.be/en/tech-watch>)
