All C# extension methods for type dictionary-tkey-tvalue
-
Dictionary<K,V>.GetValueOrDefault()
If you attempt to get a value from a dictionary using a key that doesn't exist, it throws a KeyNotFoundException. But this extension method to return a default value when the key doesn't exist. Also supports an overload with a Lazy initialization of the fallback value.