Tenancy Configuration
You can configure tenancy programmatically or through configuration files. Both approaches map to the same options and resolver types.
Programmatic Configuration
Section titled “Programmatic Configuration”builder.AddCratisArcCore(options =>{ options.UseHeaderTenancy("X-Custom-Tenant");
// options.UseQueryTenancy("tenant"); // options.UseClaimTenancy("tenant_id"); // options.UseDevelopmentTenancy("test-tenant");});Configuration File (appsettings.json)
Section titled “Configuration File (appsettings.json)”{ "Cratis": { "Arc": { "Tenancy": { "ResolverType": "Header", "HttpHeader": "X-Tenant-ID" } } }}Resolver-Specific Settings
Section titled “Resolver-Specific Settings”Header Resolver
Section titled “Header Resolver”{ "Tenancy": { "ResolverType": "Header", "HttpHeader": "X-Custom-Tenant" }}Query Resolver
Section titled “Query Resolver”{ "Tenancy": { "ResolverType": "Query", "QueryParameter": "tenant" }}Claim Resolver
Section titled “Claim Resolver”{ "Tenancy": { "ResolverType": "Claim", "ClaimType": "tenant_id" }}Development Resolver
Section titled “Development Resolver”{ "Tenancy": { "ResolverType": "Development", "DevelopmentTenantId": "local-tenant" }}