Example #1
0
            internal static object Get(SettingStoreType type, string identity)
            {
                var key = new KeyValuePair <SettingStoreType, string>(type, identity);

                if (!_settingStore.ContainsKey(key))
                {
                    return(null);
                }

                return(_settingStore[key]);
            }
 private static string GetRawValueForCustomStore(SettingStoreType settingStoreType, string storeIdentity, string tenantKey, Type typeOfSetting, string settingKey)
 {
     if (SettingStores.Get(SettingStoreType.Custom, storeIdentity) is Func <SettingStoreMetadata, string> getRawValueFunc)
     {
         if (getRawValueFunc != null)
         {
             return(getRawValueFunc.Invoke(new SettingStoreMetadata(storeIdentity, tenantKey, settingKey, typeOfSetting)));
         }
         else
         {
             throw new Exception("Please setup method 'GetRawValueFunc(storeIdentity, tenantKey, settingKey)' for Custom source");
         }
     }
     else
     {
         throw new AppCfgException($"Please config for Custom source: Can not load sourceConfig for storeIdentity {storeIdentity}");
     }
 }
Example #3
0
 public StoreOptionAttribute(SettingStoreType storeType, string storeIdentity)
 {
     SettingStoreType = storeType;
     StoreIdentity    = storeIdentity;
 }
Example #4
0
 public StoreOptionAttribute(SettingStoreType storeType)
 {
     SettingStoreType = storeType;
 }