Open Closed

Custom FeatureValueProvider Not Invoked When DefaultValue Is Set in .AddFeature #9243


User avatar
0
karl.ettinger@energieag.at created

Hi!

I have implemented a FeatureValueProvider for roles (RoleBasedFeatureValueProvider) and registered it as the first provider in the list of FeatureValueProviders. However, I noticed that when I specify a defaultValue in .AddFeature, my RoleBasedFeatureValueProvider is not invoked. If I leave out the defaultValue in .AddFeature, the text fields of type FreeTextStringValueType appear disabled in the Blazor UI under Administrator → Saas → Editions → Default Edition → Features. This behavior seems quite unexpected. As a workaround, I had to modify my RoleBasedFeatureValueProvider so that, upon the first call to FeatureChecker.IsEnabledAsync, an entry is created in the AbpFeatureValues table.

Could you please explain why my RoleBasedFeatureValueProvider, although registered first in the list, is ignored when a defaultValue is provided in .AddFeature?

Thank you!


1 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Can you share full code or a test project to reproduce?

    liming.ma@volosoft.com

    Thanks.

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
Do you need assistance from an ABP expert?
Schedule a Meeting
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v9.3.0-preview. Updated on May 12, 2025, 05:22