Generated Code¶
The Tenancy module generates a TenantId TypedId. The middleware and options are hand-written runtime code.
TenantId TypedId¶
Generates:
- JSON converter for serialization
- Implicit conversion from/to string
- Value equality and comparison
DI Registration¶
Tenancy is registered as part of the runtime bootstrapper:
// Generated in Add{Runtime}()
services.Configure<TenancyOptions>(configuration.GetSection("Deepstaging:Tenancy"));
The TenantMiddleware is added to the ASP.NET Core pipeline separately:
What Is NOT Generated¶
Unlike most modules, Tenancy does not have an [EffectsModule]. The tenant context is propagated via CorrelationContext (ambient AsyncLocal), which every effect pipeline inherits automatically. See Effects Composition for how tenant flows through effect pipelines.