public async Task <FeatureListDto> GetAsync([NotNull] string providerName, [NotNull] string providerKey) { await CheckProviderPolicy(providerName); var featureDefinitions = _featureDefinitionManager.GetAll(); var features = new List <FeatureDto>(); foreach (var featureDefinition in featureDefinitions) { features.Add(new FeatureDto { Name = featureDefinition.Name, ValueType = featureDefinition.ValueType, Description = featureDefinition.Description?.Localize(_stringLocalizerFactory), ParentName = featureDefinition.Parent?.Name, Value = await _featureManager.GetOrNullAsync(featureDefinition.Name, providerName, providerKey) }); } SetFeatureDepth(features, providerName, providerKey); return(new FeatureListDto { Features = features }); }
protected virtual async Task <ApplicationFeatureConfigurationDto> GetFeaturesConfigAsync() { var result = new ApplicationFeatureConfigurationDto(); foreach (var featureDefinition in _featureDefinitionManager.GetAll()) { if (!featureDefinition.IsVisibleToClients) { continue; } result.Values[featureDefinition.Name] = await FeatureChecker.GetOrNullAsync(featureDefinition.Name); } return(result); }
protected virtual async Task <ApplicationFeatureConfigurationDto> GetFeaturesConfigAsync() { Logger.LogDebug("Executing AbpApplicationConfigurationAppService.GetFeaturesConfigAsync()"); var result = new ApplicationFeatureConfigurationDto(); foreach (var featureDefinition in _featureDefinitionManager.GetAll()) { if (!featureDefinition.IsVisibleToClients) { continue; } result.Values[featureDefinition.Name] = await FeatureChecker.GetOrNullAsync(featureDefinition.Name).ConfigureAwait(false); } Logger.LogDebug("Executed AbpApplicationConfigurationAppService.GetFeaturesConfigAsync()"); return(result); }