Docs
Tenantry CoreAPI reference

ITenantDescriptor<TKey> interface

Namespace: Tenantry · Package: Tenantry.Core · API reference

Represents a resolved tenant.

Implement it on your own type to carry what your application knows about a tenant (its plan, region or connection string), and return that type from your ITenantStore<TKey>. Tenantry reads only ITenantDescriptor<TKey>.TenantId and ITenantDescriptor.Name; your code reads the rest with TenantDescriptorExtensions.As<TTenant> or ITenantContext<TKey>.GetCurrentTenant<TTenant>.

public interface ITenantDescriptor<out TKey> : ITenantDescriptor where TKey : IEquatable<TKey>, IParsable<TKey>

Type parameters

  • TKey: The type used for tenant identifiers (e.g. Guid, string, int). Must implement IEquatable<T> so EF Core can translate equality checks to SQL, and IParsable<TSelf> so a tenant id can be parsed from text, such as a request's identifier.

Derived types: TenantDescriptor<TKey>.

Properties

TenantId

Unique tenant identifier used for data isolation.

TKey TenantId { get; }

Value: TKey

On this page