Click or drag to resize

CollectionExtensionsTransposeTKey, TValue Method

Transposes the specified items, i.e. exchanges key and value.

Namespace:  TomsToolbox.Essentials
Assembly:  TomsToolbox.Essentials (in TomsToolbox.Essentials.dll)
Syntax
public static IEnumerable<KeyValuePair<TValue, TKey>> Transpose<TKey, TValue>(
	this IEnumerable<KeyValuePair<TKey, TValue>> items
)

Parameters

items
Type: System.Collections.GenericIEnumerableKeyValuePairTKey, TValue
The items.

Type Parameters

TKey
The type of the key.
TValue
The type of the value.

Return Value

Type: IEnumerableKeyValuePairTValue, TKey
The transposed items.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerableKeyValuePairTKey, TValue. 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