How to add tenant at runtime
Hi there !
Great work on orchard core and i am thinking of using it for a new SAAS product I am developing.
I have two questions though ( since the docs seem to be not there )
-
I can add tenants via the configuration file, but how can i add them at runtime ? e.g have an admin area or self registration feature for users ...
-
Are modules loaded in an assemblyloadcontext and isolated from the main application ?
Do not edit the configuration file directly.
You can manage the tenants from the admin of the default site.
Connected with the admin, enable the Tenants feature and you will have access to the Tenants page.
Thank you, but i am using Orchard Core only as a Module/Multitenancy enabling layer. No Ui whatsoever. So i don't want to use the predefined Admin Module, but since that module can do it obviously programmatically, i will check that source code to see how it is doing it.
It seems to me that the relevant logic is in: AdminController
You can check what the admin controller is doing in this module, correct. You can also check https://github.com/OrchardCMS/TryOrchardCore which is what we use to let users try orchard core by creating playground websites dynamically. It's available at https://try.orchardcore.net