-
|
I am building a background task in OrchardCore that needs user-configurable inputs like a connection string and cron |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
|
Your logic being a background task doesn't really affect how settings can be (are recommended to be) managed. The easiest is probably to use Custom Settings: https://docs.orchardcore.net/en/latest/reference/modules/CustomSettings/ |
Beta Was this translation helpful? Give feedback.
-
|
I think it would be best to use SiteSettings, you can create a page that is accessible via the admin menu then persist the data to the database. Then in your task get the settings like so The email and github modules are good references: |
Beta Was this translation helpful? Give feedback.
-
|
Nothing prevents you to use a |
Beta Was this translation helpful? Give feedback.
I think it would be best to use SiteSettings, you can create a page that is accessible via the admin menu then persist the data to the database. Then in your task get the settings like so
The email and github modules are good references:
https://github.com/OrchardCMS/OrchardCore/blob/e9d622f5838f40869d704d27f5a3faa6a56f1538/src/OrchardCore.Modules/OrchardCore.Email.Smtp/Drivers/SmtpSettingsDisplayDriver.cs