Exemplo n.º 1
0
        protected virtual async Task SaveAsync()
        {
            try
            {
                var features = new UpdateFeaturesDto
                {
                    Features = Groups.SelectMany(g => g.Features).Select(f => new UpdateFeatureDto
                    {
                        Name  = f.Name,
                        Value = f.ValueType is ToggleStringValueType ? ToggleValues[f.Name].ToString() :
                                f.ValueType is SelectionStringValueType ? SelectionStringValues[f.Name] : f.Value
                    }).ToList()
                };

                await FeatureAppService.UpdateAsync(ProviderName, ProviderKey, features);

                await CurrentApplicationConfigurationCacheResetService.ResetAsync();

                await InvokeAsync(Modal.Hide);
            }
            catch (Exception ex)
            {
                await HandleErrorAsync(ex);
            }
        }
Exemplo n.º 2
0
 public virtual async Task UpdateAsync(string providerName, string providerKey, UpdateFeaturesDto input)
 {
     await RequestAsync(nameof(UpdateAsync), new ClientProxyRequestTypeValue
     {
         { typeof(string), providerName },
         { typeof(string), providerKey },
         { typeof(UpdateFeaturesDto), input }
     });
 }
Exemplo n.º 3
0
        public virtual async Task <IActionResult> OnPostAsync()
        {
            var features = new UpdateFeaturesDto {
                Features = Features.Select(f => new UpdateFeatureDto {
                    Name  = f.Name,
                    Value = f.Type == nameof(ToggleStringValueType) ? f.BoolValue.ToString() : f.Value
                }).ToList()
            };

            await FeatureAppService.UpdateAsync(ProviderName, ProviderKey, features);

            return(NoContent());
        }
Exemplo n.º 4
0
        private async Task SaveAsync()
        {
            var features = new UpdateFeaturesDto
            {
                Features = _groups.SelectMany(g => g.Features).Select(f => new UpdateFeatureDto
                {
                    Name  = f.Name,
                    Value = f.ValueType is ToggleStringValueType ? ToggleValues[f.Name].ToString() : f.Value
                }).ToList()
            };

            await FeatureAppService.UpdateAsync(_providerName, _providerKey, features);

            _modal.Hide();
        }
        protected virtual async Task SaveAsync()
        {
            var features = new UpdateFeaturesDto
            {
                Features = Groups.SelectMany(g => g.Features).Select(f => new UpdateFeatureDto
                {
                    Name  = f.Name,
                    Value = f.ValueType is ToggleStringValueType ? ToggleValues[f.Name].ToString() :
                            f.ValueType is SelectionStringValueType ? SelectionStringValues[f.Name] : f.Value
                }).ToList()
            };

            await FeatureAppService.UpdateAsync(ProviderName, ProviderKey, features);

            Modal.Hide();
        }
Exemplo n.º 6
0
        public virtual async Task <IActionResult> OnPostAsync()
        {
            var features = new UpdateFeaturesDto
            {
                Features = FeatureGroups.SelectMany(g => g.Features).Select(f => new UpdateFeatureDto
                {
                    Name  = f.Name,
                    Value = f.Type == nameof(ToggleStringValueType) ? f.BoolValue.ToString() : f.Value
                }).ToList()
            };

            await FeatureAppService.UpdateAsync(ProviderName, ProviderKey, features);

            await LocalEventBus.PublishAsync(
                new CurrentApplicationConfigurationCacheResetEventData()
                );

            return(NoContent());
        }
Exemplo n.º 7
0
    public virtual async Task UpdateAsync([NotNull] string providerName, string providerKey, UpdateFeaturesDto input)
    {
        await CheckProviderPolicy(providerName, providerKey);

        foreach (var feature in input.Features)
        {
            await FeatureManager.SetAsync(feature.Name, feature.Value, providerName, providerKey);
        }
    }
Exemplo n.º 8
0
 public virtual Task UpdateAsync(string providerName, string providerKey, UpdateFeaturesDto input)
 {
     return(FeatureAppService.UpdateAsync(providerName, providerKey, input));
 }