 | ExtensionMethodskGetValueOrDefaultTKey, TValue Method |
Gets the value or default if key doesn't exist.
Namespace:
Koden.Utils.Extensions
Assembly:
Koden.Utils (in Koden.Utils.dll) Version: 1.1.6453.26060
Syntaxpublic static TValue kGetValueOrDefault<TKey, TValue>(
this IDictionary<TKey, TValue> dictionary,
TKey key,
TValue defRet
)
<ExtensionAttribute>
Public Shared Function kGetValueOrDefault(Of TKey, TValue) (
dictionary As IDictionary(Of TKey, TValue),
key As TKey,
defRet As TValue
) As TValue
public:
[ExtensionAttribute]
generic<typename TKey, typename TValue>
static TValue kGetValueOrDefault(
IDictionary<TKey, TValue>^ dictionary,
TKey key,
TValue defRet
)
[<ExtensionAttribute>]
static member kGetValueOrDefault :
dictionary : IDictionary<'TKey, 'TValue> *
key : 'TKey *
defRet : 'TValue -> 'TValue
Parameters
- dictionary
- Type: System.Collections.GenericIDictionaryTKey, TValue
The dictionary. - key
- Type: TKey
The key. - defRet
- Type: TValue
The definition ret.
Type Parameters
- TKey
- The type of the T key.
- TValue
- The type of the T value.
Return Value
Type:
TValueDictionary Value
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
IDictionaryTKey,
TValue. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
See Also