- What is your product version?
- What is your product type (Angular or MVC)?
- What is product framework type (.net framework or .net core)?
- .net core
How can i add a new SettingScope? I need some settings to be linked to User and their Companies or Working Sites. When retrieved they should fallback up to Company starting at User level.
Do i need to create a specific Setting entity? Also a new SettingManager?
Any tip? Thanks
It is a bit hard to add a new SettingScope. SettingScopes are defined as enum, https://github.com/aspnetboilerplate/aspnetboilerplate/blob/dev/src/Abp/Configuration/SettingScope.cs.
Duplicating the entire logic will be hard. You can try to create your own SettingManager inheriting from default SettingManager and override
GetSettingValueInternalmethods to include your logic.
Finally, you need to replace default Setting manager with your version in PreInitialize method of your Core module as shown below;
SettingDefinition is not an Entity, https://github.com/aspnetboilerplate/aspnetboilerplate/blob/dev/src/Abp.Zero.Common/Configuration/Setting.cs is used as an Entity. So, you can relate this one with your entity. SettingDefinition is mapped to Setting when saving to DB.
Hi ismcagdas, I've extended Setting entity following this tutorial https://docs.aspnetzero.com/en/common/latest/Extending-Existing-Entities#extending-non-abstract-entities. It added two fields, the fk I needed and Discriminator.
You've mention to create a new SettingManager inheriting from default one, I was able to do that, also replacing the service ISettingManager in PreInitialize on WebMvcModule, but it doesn't allow me to override those methods. Also, I can't see them in default SettingManager as well. I'm I missing something? I accomplish that by replicate the method GetSettingValueForUserAsync in my AppHubSettingProvider.
Nevertheless i'm still missing two more methods, Save and Get based on related entity. Like GetSettingValueForApplication, ChangeSettingForApplication. Should I extend interface SettingManager or create a new one?