| ExtensionMethodsToDictionaryIgnoringDuplicatesTSource, TKey Method (IEnumerableTSource, FuncTSource, TKey) |
Namespace:
SanteDB.Core
Assembly:
SanteDB.Core.Api (in SanteDB.Core.Api.dll) Version: 3.0.481-alpha
Syntax public static Dictionary<TKey, TSource> ToDictionaryIgnoringDuplicates<TSource, TKey>(
this IEnumerable<TSource> source,
Func<TSource, TKey> keySelector
)
<ExtensionAttribute>
Public Shared Function ToDictionaryIgnoringDuplicates(Of TSource, TKey) (
source As IEnumerable(Of TSource),
keySelector As Func(Of TSource, TKey)
) As Dictionary(Of TKey, TSource)
public:
[ExtensionAttribute]
generic<typename TSource, typename TKey>
static Dictionary<TKey, TSource>^ ToDictionaryIgnoringDuplicates(
IEnumerable<TSource>^ source,
Func<TSource, TKey>^ keySelector
)
[<ExtensionAttribute>]
static member ToDictionaryIgnoringDuplicates :
source : IEnumerable<'TSource> *
keySelector : Func<'TSource, 'TKey> -> Dictionary<'TKey, 'TSource>
Parameters
- source
- Type: System.Collections.GenericIEnumerableTSource
An IEnumerableT to create a DictionaryTKey, TValue from. - keySelector
- Type: SystemFuncTSource, TKey
A function to extract a key from each element.
Type Parameters
- TSource
- The type of the elements of source.
- TKey
- The type of the key returned by keySelector.
Return Value
Type:
DictionaryTKey,
TSource
A
DictionaryTKey, TValue that contains values of type
TSource selected from the input sequence.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
IEnumerableTSource. 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