OrchardCore.Samples icon indicating copy to clipboard operation
OrchardCore.Samples copied to clipboard

How to add tenant at runtime

Open BernhardGlueck opened this issue 2 years ago • 4 comments

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 )

  1. 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 ...

  2. Are modules loaded in an assemblyloadcontext and isolated from the main application ?

BernhardGlueck avatar Sep 20 '23 19:09 BernhardGlueck

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.

agriffard avatar Sep 20 '23 20:09 agriffard

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.

BernhardGlueck avatar Sep 20 '23 20:09 BernhardGlueck

It seems to me that the relevant logic is in: AdminController

BernhardGlueck avatar Sep 20 '23 20:09 BernhardGlueck

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

sebastienros avatar Sep 20 '23 21:09 sebastienros