Docs
Tenantry CoreAPI reference

ITenantScope<TKey> interface

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

A dependency-injection scope with a tenant current, created by ITenantScopeFactory<TKey>.

Disposing the scope (synchronously or asynchronously) disposes its services while the tenant is still current, 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 ITenantScope<TKey> : IServiceScope, IDisposable, IAsyncDisposable where TKey : IEquatable<TKey>, IParsable<TKey>

Type parameters

Properties

Tenant

The tenant this scope runs as.

ITenantDescriptor<TKey> Tenant { get; }

Value: ITenantDescriptor<TKey>

On this page