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 implementIEquatable<T>so EF Core can translate equality checks to SQL, andIParsable<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
ITenantDescriptor interface
A tenant, without its identifier type: the base of ITenantDescriptor<TKey>tenantry-itenantdescriptor-1.md, for code that does not need the tenant's id, such as TenantDescriptorExtensions.As<TTenant>tenantry-tenantdescriptorextensions.md.
ITenantEntity<TKey> interface
Marks an entity that belongs to a tenant.