Esempio n. 1
0
 public static DictionaryResult <TValue> TryGet <TKey, TValue>(this IDictionary <TKey, TValue> dict, TKey key)
 {
     if (dict.TryGetValue(key, out var val))
     {
         return(DictionaryResult <TValue> .Found(val));
     }
     return(DictionaryResult <TValue> .NotFound());
 }
Esempio n. 2
0
        public static DictionaryResult <T> Found(T value)
        {
            var result = new DictionaryResult <T>(value);

            return(result);
        }