Click or drag to resize

RouletteDictionaryTKey, TValueGetRandomValue Method (FuncTValue, Boolean)

Gets a random value from the dictionary that satisfies a condition.

Namespace:  Scaleout.Collections
Assembly:  Scaleout.Collections (in Scaleout.Collections.dll) Version: 1.0.3.0 (1.0.3.0)
Syntax
C#
public TValue GetRandomValue(
	Func<TValue, bool> predicate
)

Parameters

predicate
Type: SystemFuncTValue, Boolean
A function to test elements for a condition.

Return Value

Type: TValue
A random value from the dictionary.
Exceptions
ExceptionCondition
InvalidOperationException The dictionary is empty or no entries satisfy the predicate.
See Also