Click or drag to resize

ExtensionsGetTKey, TValue Method (IReadOnlyDictionaryTKey, TValue, TKey)

Attempts to get the value for a given key from a dictionary, returning the compiler default value if not successful

Namespace:  Couchbase.Lite.Util
Assembly:  Couchbase.Lite (in Couchbase.Lite.dll) Version: 2.0.0-b0295
Syntax
C#
public static TValue Get<TKey, TValue>(
	this IReadOnlyDictionary<TKey, TValue> d,
	TKey key
)

Parameters

d
Type: System.Collections.GenericIReadOnlyDictionaryTKey, TValue
The dictionary to operate on (implicit)
key
Type: TKey
The key to attempt to retrieve the value for

Type Parameters

TKey
The key type of the dictionary
TValue
The value type of the dictionary

Return Value

Type: TValue
The value for the given key, or a default value

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IReadOnlyDictionaryTKey, 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