Tenantry CoreAPI reference
ITenantServiceScope<TKey> interface
Namespace: Tenantry.Core · Package: Tenantry.Core · API reference
A dependency-injection scope with a tenant active, created by ITenantScopeFactory<TKey>.
Disposing the scope (synchronously or asynchronously) disposes its services while the tenant is still active, then restores the tenant that was current when the scope was created. Both forms restore the tenant in the disposing code's own context, so await using is safe in loops and nested scopes.
public interface ITenantServiceScope<TKey> : IServiceScope, IDisposable, IAsyncDisposable where TKey : IEquatable<TKey>, IParsable<TKey>Type parameters
TKey: The tenant identifier type. SeeITenantDescriptor<TKey>for constraints.
Properties
Tenant
The tenant this scope runs as.
ITenantDescriptor<TKey> Tenant { get; }Value: ITenantDescriptor<TKey>