Click or drag to resize

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
Syntax
public static TValue kGetValueOrDefault<TKey, TValue>(
	this IDictionary<TKey, TValue> dictionary,
	TKey key,
	TValue defRet
)

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: TValue
Dictionary 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