Aerospike.Database.LINQPadDriver.Extensions Namespace
Aerospike LINDPad Driver

AValueHelper..::..TryGetValue<(Of <(<'T, R>)>)> Method (IEnumerable<(Of <(<'AValue>)>)>, T, R)

Returns the converted value based on R, if possible, only if there is a match based on matchValue and this AValue's Value. If the matched value cannot be converted to R, this will return false. A match occurs when any of the following happens: Value is a IEnumerable or JArray and one of the elements matches matchValueValue is a IDictionary and the key matches matchValueValue is a KeyValuePair and the key matches matchValue If matchValue is a KeyValuePair, both the key and value must match Value is a String and matchValue is contained within Otherwise ValueEquals(Object) is applied against matchValue

Namespace:  Aerospike.Database.LINQPadDriver.Extensions
Assembly:  Aerospike.Database.LINQPadDriver (in Aerospike.Database.LINQPadDriver.dll)

Syntax


public static R TryGetValue<T, R>(
	this IEnumerable<AValue> source,
	T matchValue,
	R defaultValue
)

Type Parameters

T
matchValue's type
R
The type used to convert the matched value

Parameters

source
Type: IEnumerable<(Of <(<'AValue>)>)>
A collection of AValue values.
matchValue
Type: T
The value used to determine if a match occurred.
defaultValue
Type: R
The default value if a match dose not occur or the value could not be converted.

Return Value

Returns the converted matched value, if possible. If a match dose not occur or the value could not be converted, this will return defaultValue.

See Also


[AValue.TryGetValue{R}(object, R)]
[TryGetValue{T, R}(IEnumerable{AValue}, T, out R)]
[TryGetValue{T}(IEnumerable{AValue}, T, bool)]
[TryGetValue{T}(IEnumerable{AValue}, T, out AValue)]