在 Autofac 中即时重新配置多租户容器
Reconfigure multitenant container on the fly in Autofac
我需要更新多租户容器中租户的配置。我可以用 Autofac 做还是我应该实现自定义容器?
不支持为已设置的租户更改多租户容器的内容。您可以 add registrations to a child lifetime scope spun off of a tenant scope, but you can't change the tenant scope without rebuilding the container. In general, you should treat a container as immutable - 一旦构建并从中解决了某些问题,就不应更改它。
我需要更新多租户容器中租户的配置。我可以用 Autofac 做还是我应该实现自定义容器?
不支持为已设置的租户更改多租户容器的内容。您可以 add registrations to a child lifetime scope spun off of a tenant scope, but you can't change the tenant scope without rebuilding the container. In general, you should treat a container as immutable - 一旦构建并从中解决了某些问题,就不应更改它。