Table of Contents

Class TenantDefaults

Namespace
Excalibur.Dispatch
Assembly
Excalibur.Dispatch.Abstractions.dll

Provides default values for tenant configuration.

public static class TenantDefaults
Inheritance
TenantDefaults
Inherited Members

Remarks

Single-tenant applications use DefaultTenantId automatically when no explicit tenant identifier is configured. Multi-tenant applications establish the ambient tenant per operation (via TenantContextHolder.BeginScope / tenant middleware) and read it through ITenantContext.

Fields

DefaultTenantId

The single canonical tenant identifier used when multi-tenancy is not configured. Single-tenant applications use this value automatically, and every tenant-scoped write and read path references this one field so all writers agree on a single value.

public static readonly string DefaultTenantId

Field Value

string

Remarks

The double-underscore shape is chosen so this value is unlikely to collide with a tenant a real deployment would name — a deployment may legitimately have a tenant called "Default". The value is also deliberately non-empty and portable across relational stores: an empty string is coerced to null by some databases, which would silently widen a tenant-scoped query.

This is a real tenant identity, not a reserved sentinel, despite sharing that shape. It is the identity a single-tenant deployment actually operates as, it is what SingleTenantContext returns, and it is a legal value everywhere a tenant identifier is accepted. Only one identifier in this framework is genuinely reserved and rejected on construction — the untenanted marker on TenantScope — and this is not it. Do not treat the two interchangeably because they look alike: rejecting this value, or substituting the untenanted marker for it, changes which rows a single-tenant deployment can see.

Deliberately static readonly rather than a const. A const is inlined into every assembly that references it, so a consumer compiled against one value keeps writing and querying that value after the framework adopts another — with no compile error and no runtime failure, only rows landing under a tenant identity the framework no longer uses. Because this value decides which rows an operation can see, that divergence is silent data misplacement rather than a cosmetic mismatch. A field is resolved at run time, so every assembly in the process necessarily agrees on one identity.