Ir al contenido

Buscar en el Ecosistema EricksonLopez.*

Escribe el nombre de una librería, ID de paquete NuGet, tipo .NET o concepto arquitectónico para buscar en el portal.

Conceptos Fundamentales — TenantId, ITenantContext y Estrategias

EricksonLopez.MultiTenancy gira en torno a identificadores de inquilino inmutables y precedencia explícita de resolución.

  • TenantId (readonly record struct, ISpanParsable<TenantId>): Soporta Create(Guid|string|ReadOnlySpan<char>), Parse, TryParse, From(...) -> Result<TenantId>, TryCreate, NewId() (UUIDv7 en .NET 9+), Empty e IsEmpty.
  • TenantInfo (record class : ITenantInfo): new TenantInfo(TenantId id, string name, string? connectionString = null, bool isActive = true).
  • ITenantContext: Expone Tenant, IsResolved, Source (TenantResolutionSource) y RequiredTenant (lanza TenantNotFoundException o TenantInactiveException).
  • TenantErrors: NotFound(TenantId), Unresolved, Inactive(TenantId), InvalidId(string?), StrategyFailed(string, string?).

Registra estrategias desde AspNetCoreMultiTenancyExtensions (namespace EricksonLopez.MultiTenancy): AddRouteTenantStrategy(pattern), AddHostNameTenantStrategy(...), AddBasePathStrategy(segmentIndex), AddInternalHeaderTenantResolution(expectedSharedSecret, headerName, secretHeaderName), AddStaticTenantStrategy(TenantId), AddDelegateTenantStrategy(...), por claims y por query/cookie.