Skip to content

Search EricksonLopez.* Ecosystem

Type a library name, NuGet package ID, .NET type, or architectural concept to search across the portal.

Core Concepts — TenantId, ITenantContext & Resolution Strategies

EricksonLopez.MultiTenancy centers on immutable tenant identifiers and explicit resolution precedence.

  • TenantId (readonly record struct, ISpanParsable<TenantId>): Supports Create(Guid|string|ReadOnlySpan<char>), Parse, TryParse, From(...) -> Result<TenantId>, TryCreate, NewId() (UUIDv7 on .NET 9+), Empty, and IsEmpty.
  • TenantInfo (record class : ITenantInfo): new TenantInfo(TenantId id, string name, string? connectionString = null, bool isActive = true).
  • ITenantContext: Exposes Tenant, IsResolved, Source (TenantResolutionSource), and RequiredTenant (throws TenantNotFoundException or TenantInactiveException if unresolved/inactive).
  • TenantErrors: NotFound(TenantId), Unresolved, Inactive(TenantId), InvalidId(string?), StrategyFailed(string, string?).

Register resolution strategies via AspNetCoreMultiTenancyExtensions (namespace EricksonLopez.MultiTenancy): AddRouteTenantStrategy(pattern), AddHostNameTenantStrategy(...), AddBasePathStrategy(segmentIndex), AddInternalHeaderTenantResolution(expectedSharedSecret, headerName, secretHeaderName), AddStaticTenantStrategy(TenantId), AddDelegateTenantStrategy(...), claim-based resolution, and query/cookie strategies.