 | BcfReadOnlyArrayListExtensionsToDictionaryTSource, TKey Method (BcfReadOnlyArrayListTSource, FuncTSource, TKey, IEqualityComparerTKey) |
Creates a dictionary based on the contents of this array.
Namespace:
System.Linq
Assembly:
CalculationWorks.BusinessModel (in CalculationWorks.BusinessModel.dll) Version: 4.2.0
Syntaxpublic static Dictionary<TKey, TSource> ToDictionary<TSource, TKey>(
this BcfReadOnlyArrayList<TSource> source,
Func<TSource, TKey> keySelector,
IEqualityComparer<TKey> comparer
)
<ExtensionAttribute>
Public Shared Function ToDictionary(Of TSource, TKey) (
source As BcfReadOnlyArrayList(Of TSource),
keySelector As Func(Of TSource, TKey),
comparer As IEqualityComparer(Of TKey)
) As Dictionary(Of TKey, TSource)
Parameters
- source
- Type: CalculationWorks.BusinessModelBcfReadOnlyArrayListTSource
The source. - keySelector
- Type: SystemFuncTSource, TKey
The key selector. - comparer
- Type: System.Collections.GenericIEqualityComparerTKey
The comparer to initialize the dictionary with.
Type Parameters
- TSource
- The type of the elements of source.
- TKey
- The type of the key.
Return Value
Type:
DictionaryTKey,
TSourceThe newly initialized dictionary.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
BcfReadOnlyArrayListTSource. 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