Method GetValueOrDefault
GetValueOrDefault(TKey, TValue)
Gets the value associated with the specified key.
Returns defaultValue if the key is not found.
public TValue GetValueOrDefault(TKey key, TValue defaultValue = default)
Parameters
keyTKeyThe key of the value to get.
defaultValueTValueDefault value.
Returns
- TValue
GetValueOrDefault(TKey, Func<TValue>)
Gets the value associated with the specified key.
Returns a result of func function call
if the key is not found.
public TValue GetValueOrDefault(TKey key, Func<TValue> func)
Parameters
keyTKeyThe key of the value to get.
funcFunc<TValue>Default value provider function.
Returns
- TValue