Base solution for your next web application
Open Closed

Weird behavior in SettingManager?! #2964


User avatar
0
omital created

Hi, Recntly I faced with weird behavior in Setting manager. When I call

SettingManager.ChangeSettingForTenantAsync(tenantId, name, value);

my setting will be deleted from AbpSetttings. I check sqlserver profiler and find this code:

exec sp_executesql N'DELETE [dbo].[AbpSettings]
WHERE ([Id] = @0)',N'@0 bigint',@0=112

WHY?


2 Answer(s)
  • User Avatar
    0
    omital created

    found. When setting value is equal to default value (initialized in SettingProvider) abp delete related row from abpSettings entity. I think this is a bad thing?! suppose that user set setting value to default value , related row will be deleted from abpSettings entity, now we release new version and seed method execute . the final conclusion is that "<ins>Seed method create new row in AbpSettings that maybe have a diffrente value compare with those user value</ins>" .

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    You can set isInherited for your setting if you don't want that behaviour. See <a class="postlink" href="https://www.aspnetboilerplate.com/Pages/Documents/Setting-Management">https://www.aspnetboilerplate.com/Pages ... Management</a>.