MultitenantContainerConfigureTenant Method |
Namespace: Autofac.Multitenant
Exception | Condition |
---|---|
ArgumentNullException | Thrown if configuration is . |
InvalidOperationException | Thrown if the tenant indicated by tenantId has already been configured. |
If you need to configure a tenant across multiple registration calls, consider using a ConfigurationActionBuilder and configuring the tenant using the aggregate configuration action it produces.
Note that if GetTenantScope(Object) is called using the tenant ID, it builds the tenant scope with the default (container) configuration, which will also preclude the tenant from being configured. This includes the case where a dependency is resolved from the MultitenantContainer when the tenant ID is returned by the registered TenantIdentificationStrategy. If configuration can occur after application startup, use ReconfigureTenant(Object, ActionContainerBuilder) or "lock out" un-configured tenants using TenantIsConfigured(Object) or other mechanism.