示例#1
0
        public Task SetAsync <T>(ISettingStoreContext context, T value)
        {
            var key = $"{context.Properties.Values.ExpandToString(":")}:{context.SettingDefinition.Name}";

            _values[key] = value;
            return(Task.CompletedTask);
        }
示例#2
0
        public Task <SettingValue <T> > GetAsync <T>(ISettingStoreContext context)
        {
            var key   = $"{context.Properties.Values.ExpandToString(":")}:{context.SettingDefinition.Name}";
            var value = _values.GetOrDefault(key);

            if (value == null)
            {
                return(Task.FromResult <SettingValue <T> >(null));
            }
            return(Task.FromResult(new SettingValue <T> {
                Definition = context.SettingDefinition, Value = (T)value
            }));
        }
示例#3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="context"></param>
 protected virtual void ConfigContext(ISettingStoreContext context)
 {
 }