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()); }
public static DictionaryResult <T> Found(T value) { var result = new DictionaryResult <T>(value); return(result); }