コード例 #1
0
        protected virtual async Task <Dictionary <string, string> > GetOrNullValueFromProvidersAsync(
            IEnumerable <IAppValueProvider> providers,
            AppDefinition app)
        {
            foreach (var provider in providers)
            {
                var value = await provider.GetOrNullAsync(app);

                if (value != null)
                {
                    return(value);
                }
            }

            return(null);
        }
コード例 #2
0
        public virtual Task <Dictionary <string, string> > GetOrNullAsync(AppDefinition setting)
        {
            var result  = new Dictionary <string, string>();
            var section = Configuration.GetSection(ConfigurationNamePrefix + setting.Name).GetChildren();

            if (section == null || !section.Any())
            {
                return(Task.FromResult <Dictionary <string, string> >(null));
            }

            foreach (var v in section)
            {
                result[v.Key] = v.Value;
            }

            return(Task.FromResult(result));
        }
コード例 #3
0
 public abstract Task <Dictionary <string, string> > GetOrNullAsync(AppDefinition app);
コード例 #4
0
 public override async Task <Dictionary <string, string> > GetOrNullAsync(AppDefinition setting)
 {
     return(await AppStore.GetOrNullAsync(setting.Name, Name, CurrentTenant.Id?.ToString()));
 }
コード例 #5
0
 public override Task <Dictionary <string, string> > GetOrNullAsync(AppDefinition app)
 {
     return(Task.FromResult(app.DefaultValues));
 }
コード例 #6
0
 public override Task <Dictionary <string, string> > GetOrNullAsync(AppDefinition setting)
 {
     return(AppStore.GetOrNullAsync(setting.Name, Name, null));
 }