What problem does it solve?
Multi-tenant .NET applications risk data leakage, operational interference, and complex connection management; this guide provides patterns to enforce tenant isolation, automate onboarding, and prevent cross-tenant access.
Core Features & Use Cases
- Tenant resolution middleware that resolves tenant context from JWT claims, headers, subdomain, or query parameters and makes it available via a scoped provider.
- Per-tenant data strategies including database-per-tenant, schema-per-tenant, and shared-database with global EF Core query filters and tenant stamping on save.
- Operational guidance for onboarding/offboarding tenants, caching with tenant keys, background job tenancy, and migration/backfill strategies for existing schemas.
- Use Case: Convert a single-tenant order management system into a secure SaaS platform where each customer has logically isolated data and per-tenant connection handling.
Quick Start
Add tenant resolution middleware, register a scoped tenant provider, apply global EF Core query filters for all tenant-scoped entities, and route DbContext construction to per-tenant connection strings or fallback defaults.