Ejemplo n.º 1
0
 private Dictionary <string, int> getStringToIntDictionary(string keyName, string defaultValue,
                                                           int fallbackValue, int errorValue)
 {
     return(DictionaryStringHelper.DeserializeRawDictionaryString(getValue(keyName, defaultValue), false)
            .ToDictionary(
                item => item.Key,
                item => int.TryParse(item.Value, out int result) ? result : fallbackValue)
            .Where(x => x.Value != errorValue)
            .ToDictionary(
                item => item.Key,
                item => item.Value));
 }
Ejemplo n.º 2
0
 private Dictionary <string, string> getStringToStringDictionary(
     string keyName, string defaultValue, bool forceLowerCase)
 {
     return(DictionaryStringHelper.DeserializeRawDictionaryString(
                getValue(keyName, defaultValue), forceLowerCase));
 }