Open Closed

Efficient user of Settings and Features #262


User avatar
0
ian@order2invoice.com created
  • ABP Framework version: v2.9
  • UI type: Angular
  • Tiered (MVC) or Identity Server Seperated (Angular): no

Relating to Settings and Features.

  1. One of our most used API calls needs to receive up to 30 settings to create data for a View Model. We are concerned about the time this will take on each call. Is the settings System suitable for this style of usage? Will it be efficient?
  2. Thoughout our app we need to check both if a Feature is enabled and a Setting indicating is a particular user can use that feature (e.g. Invoice Feature is enabled for a tenant, but only some users have access). What would be the most efficient way to implement this?

3 Answer(s)
  • User Avatar
    0
    alper created
    Support Team Director

    First of all, the settings with the same key is being cached, so the second call will not go to database. Also, you can inject ISettingProvider and use GetAllAsync() to retrieve all. it's better than getting 30 of them.

    If you want to multiple features you can also injectIFeatureValueRepository see https://github.com/abpframework/abp/blob/dev/modules/feature-management/src/Volo.Abp.FeatureManagement.Domain/Volo/Abp/FeatureManagement/FeatureManagementStore.cs

    in ABP v3.0 settings and permission usage will be refactored and will be made more performance

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    GetAllAsync method internally uses a loop to get all values. It will only make writing simple, but performance will not be improved and there may be 100 settings, and only 40 of them are needed.

    I provide another solution here: https://support.abp.io/QA/Questions/263/Efficient-user-of-Settings-and-Features

  • User Avatar
    0
    alper created
    Support Team Director

    duplicate of #263. closing this one.

Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11