Stashbox by Peter Csajtai

<PackageReference Include="Stashbox" Version="3.5.1-preview-629" />

 TenantDistributor

Represents a tenant distributor that manages tenants in a multitenant environment.

The root container.

public TenantDistributor(IStashboxContainer rootContainer = null)

Constructs a TenantDistributor.

public void ConfigureTenant(object tenantId, Func<IStashboxContainer, IDisposable> tenantConfig)

Adds a tenant with a specified service configuration to the distributor.

public void Dispose()

public IDependencyResolver GetTenant(object tenantId)

Gets a pre-configured IDependencyResolver from the distributor which represents a tenant identified by the given id. When the requested tenant doesn't exist a null value will be returned.

public void Validate()

Validates the root container and the configured tenants.