Partager via


PSUtility.ToDictionary<TKey, TBase> Method (IEnumerable<TBase>, Func<TBase, TKey>, Boolean)

Reserved for internal use.

Namespace:  Microsoft.Office.Project.Server.Library
Assembly:  Microsoft.Office.Project.Server.Library (in Microsoft.Office.Project.Server.Library.dll)

Syntax

'Declaration
<ExtensionAttribute> _
Public Shared Function ToDictionary(Of TKey, TBase) ( _
    enumerable As IEnumerable(Of TBase), _
    keySelector As Func(Of TBase, TKey), _
    ignoreMultipleEntries As Boolean _
) As Dictionary(Of TKey, TBase)
'Usage
Dim enumerable As IEnumerable(Of TBase)
Dim keySelector As Func(Of TBase, TKey)
Dim ignoreMultipleEntries As Boolean
Dim returnValue As Dictionary(Of TKey, TBase)

returnValue = enumerable.ToDictionary(keySelector, _
    ignoreMultipleEntries)
public static Dictionary<TKey, TBase> ToDictionary<TKey, TBase>(
    this IEnumerable<TBase> enumerable,
    Func<TBase, TKey> keySelector,
    bool ignoreMultipleEntries
)

Type Parameters

  • TKey
  • TBase

Parameters

Return Value

Type: System.Collections.Generic.Dictionary<TKey, TBase>
Returns Dictionary<TKey, TValue>.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerable<TBase>. When you use instance method syntax to call this method, omit the first parameter. For more information, see https://msdn.microsoft.com/en-us/library/bb384936(v=office.14) or https://msdn.microsoft.com/en-us/library/bb383977(v=office.14).

See Also

Reference

PSUtility Class

PSUtility Members

ToDictionary Overload

Microsoft.Office.Project.Server.Library Namespace