Search code examples
aspnetboilerplate

How to show all settings in database?


I found that the table dbo.AbpSettings in the database only stored changed settings (the new value is different from default value). So how to make it insert all settings to the database?


Solution

  • You can implement a custom ISettingManager - in particular, skip this check:

    if (value == defaultValue)
    {
        // ...
        return null;
    }
    

    And replace the service in your module's PreInitialize() method:

    Configuration.ReplaceService<ISettingManager, MySettingManager>();