コード例 #1
0
        public virtual async Task <Dictionary <string, string> > GetOrNullAsync(string name)
        {
            var apps = AppDefinitionManager.Get(name);

            var providers = Enumerable
                            .Reverse(AppValueProviderManager.Providers);

            if (apps.Providers.Any())
            {
                providers = providers.Where(p => apps.Providers.Contains(p.Name));
            }

            //TODO: How to implement setting.IsInherited?

            var value = await GetOrNullValueFromProvidersAsync(providers, apps);

            return(value);
        }
コード例 #2
0
        public virtual async Task <List <AppValue> > GetAllAsync()
        {
            var appValues          = new Dictionary <string, AppValue>();
            var settingDefinitions = AppDefinitionManager.GetAll();

            foreach (var provider in AppValueProviderManager.Providers)
            {
                foreach (var setting in settingDefinitions)
                {
                    var value = await provider.GetOrNullAsync(setting);

                    if (value != null)
                    {
                        appValues[setting.Name] = new AppValue(setting.Name, value);
                    }
                }
            }

            return(appValues.Values.ToList());
        }