Extension methods for Dictionary<K,V> and IDictionary<K,V>.
|
static V | TryGetValue< K, V > (this Dictionary< K, V > dict, K key, V defaultValue) |
| An alternate version TryGetValue that returns a default value if the key was not found in the dictionary, and that does not throw if the key is null. More...
|
|
static V | TryGetValue< K, V > (this IDictionary< K, V > dict, K key, V defaultValue) |
|
static V | TryGetValue< K, V > (this IReadOnlyDictionary< K, V > dict, K key, V defaultValue) |
|
static Maybe< V > | TryGetValue< K, V > (this IDictionary< K, V > dict, K key) |
| Same as IDictionary.TryGetValue() except that this method does not throw an exception when key==null (it simply returns NoValue), and it returns the result as Maybe<V> instead of storing the result in an "out" parameter. More...
|
|
static Maybe< V > | TryGetValue< K, V > (this IReadOnlyDictionary< K, V > dict, K key) |
|
static bool | TryGetValueSafe< K, V > (this IDictionary< K, V > dict, K key, out V value) |
| Same as IDictionary.TryGetValue() except that this method does not throw an exception when key==null (it simply returns false). More...
|
|