KGy SOFT

EnumerableExtensionsToStringKeyedDictionaryTSource, TValue Method (IEnumerableTSource, FuncTSource, String, FuncTSource, TValue, StringSegmentComparer)

KGy SOFT Core Libraries Help

Namespace:  KGySoft.CoreLibraries
Assembly:  KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 6.0.0-rc.2
Syntax

public static StringKeyedDictionary<TValue> ToStringKeyedDictionary<TSource, TValue>(
	this IEnumerable<TSource> source,
	Func<TSource, string> keySelector,
	Func<TSource, TValue> valueSelector,
	StringSegmentComparer? comparer = null
)

Parameters

source
Type: System.Collections.GenericIEnumerableTSource
The source collection to create a StringKeyedDictionaryTValue from.
keySelector
Type: SystemFuncTSource, String
A delegate to produce a key for each element in the source collection.
valueSelector
Type: SystemFuncTSource, TValue
A delegate to produce a value for each element in the source collection.
comparer (Optional)
Type: KGySoft.CoreLibrariesStringSegmentComparer
A StringSegmentComparer to compare keys. If , then ordinal comparison will be used. This parameter is optional.
Default value: .

Type Parameters

TSource
The type of the elements in the source collection.
TValue
The type of the value returned by the specified valueSelector.

Return Value

Type: StringKeyedDictionaryTValue
A StringKeyedDictionaryTValue that contains values of type TValue created by the specified valueSelector for each elements in the source collection.

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

Reference