다음을 통해 공유


PSUtility.ToDictionary<TKey, TElement, TBase> Method (IEnumerable<TBase>, Func<TBase, TKey>, Func<TBase, TElement>, 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, TElement, TBase) ( _
    enumerable As IEnumerable(Of TBase), _
    keySelector As Func(Of TBase, TKey), _
    elementSelector As Func(Of TBase, TElement), _
    ignoreMultipleEntries As Boolean _
) As Dictionary(Of TKey, TElement)
'Usage
Dim enumerable As IEnumerable(Of TBase)
Dim keySelector As Func(Of TBase, TKey)
Dim elementSelector As Func(Of TBase, TElement)
Dim ignoreMultipleEntries As Boolean
Dim returnValue As Dictionary(Of TKey, TElement)

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

Type Parameters

  • TKey
  • TElement
  • TBase

Parameters

Return Value

Type: System.Collections.Generic.Dictionary<TKey, TElement>
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