IEnumerableExtensionsToDictionaryT1, T2 Method |
Creates a dictionary from a sequence of KeyValuePairs. If the sequence is already a Dictionary, a new Dictionary is still created.
Namespace: Bio.UtilAssembly: Bio.Core (in Bio.Core.dll) Version: 2.0.0.1 (2.0.0.1)
Syntax public static Dictionary<T1, T2> ToDictionary<T1, T2>(
this IEnumerable<KeyValuePair<T1, T2>> pairSequence
)
<ExtensionAttribute>
Public Shared Function ToDictionary(Of T1, T2) (
pairSequence As IEnumerable(Of KeyValuePair(Of T1, T2))
) As Dictionary(Of T1, T2)
public:
[ExtensionAttribute]
generic<typename T1, typename T2>
static Dictionary<T1, T2>^ ToDictionary(
IEnumerable<KeyValuePair<T1, T2>>^ pairSequence
)
[<ExtensionAttribute>]
static member ToDictionary :
pairSequence : IEnumerable<KeyValuePair<'T1, 'T2>> -> Dictionary<'T1, 'T2>
Parameters
- pairSequence
- Type: System.Collections.GenericIEnumerableKeyValuePairT1, T2
the input pair sequence
Type Parameters
- T1
- the type of Key
- T2
- the type of Value
Return Value
Type:
DictionaryT1,
T2a Dictionary
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
IEnumerableKeyValuePairT1,
T2. 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