Method ToDictionaryChecked
ToDictionaryChecked<TSource, TKey, TElement>(IEnumerable<TSource>, Func<TSource, TKey>, Func<TSource, TElement>, IEqualityComparer<TKey>)
Erzeugt ein Dictionary. Bei doppelten Keys wird jeweils nur der erste Eintrag hinzugefügt.
Declaration
[DocfxBrowsable]
public static Dictionary<TKey, TElement> ToDictionaryChecked<TSource, TKey, TElement>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, IEqualityComparer<TKey> comparer)
Parameters
source
System.Collections.Generic.IEnumerable<TSource>
keySelector
System.Func<TSource, TKey>
elementSelector
System.Func<TSource, TElement>
comparer
System.Collections.Generic.IEqualityComparer<TKey>
Returns
System.Collections.Generic.Dictionary<TKey, TElement>
Type Parameters
Name | Description |
---|---|
TSource | |
TKey | |
TElement |
ToDictionaryChecked<TSource, TKey, TElement>(IEnumerable<TSource>, Func<TSource, TKey>, Func<TSource, TElement>)
Erzeugt ein Dictionary. Bei doppelten Keys wird jeweils nur der erste Eintrag hinzugefügt.
Declaration
[DocfxBrowsable]
public static Dictionary<TKey, TElement> ToDictionaryChecked<TSource, TKey, TElement>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector)
Parameters
source
System.Collections.Generic.IEnumerable<TSource>
keySelector
System.Func<TSource, TKey>
elementSelector
System.Func<TSource, TElement>
Returns
System.Collections.Generic.Dictionary<TKey, TElement>
Type Parameters
Name | Description |
---|---|
TSource | |
TKey | |
TElement |