How to change the connection string based on the requested tenant? #6962
-
I am attempting to use OrchardCore as a multi-tenant app in a non-CMS app. How can I change the connection string based on the requested tenant? I tried the following but it is not working "meaning the custom connection string isn't overriding the default"
Also, is there a service that I can use that would provide me with information about the current logged in tenant like some sort of identifier without using the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
This is all very well documented https://docs.orchardcore.net/en/dev/docs/reference/core/Configuration/ You need to use
You can also inject |
Beta Was this translation helpful? Give feedback.
This is all very well documented https://docs.orchardcore.net/en/dev/docs/reference/core/Configuration/
You need to use
IShellConfiguration
if you want tenant level settings..GetConnectionString
has no meaning in this context, you should load values fromIShellConfiguration
appsettings
keys.You can also inject
ShellSettings
to get settings for a specific tenant.