Click or drag to resize

PartitionExtensionPartitionTKey, TElement, TResult Method (IEnumerableIGroupingTKey, TElement, TKey, TKey, TKey, FuncIEnumerableTElement, IEnumerableTElement, IEnumerableTElement, IEnumerableIGroupingTKey, TElement, TResult)

Partitions a grouping and projects a result from elements groups matching a set of three keys and those groups that do not.

Namespace:  MoreLinq.Extensions
Assembly:  MoreLinq (in MoreLinq.dll) Version: 3.0.0
Syntax
public static TResult Partition<TKey, TElement, TResult>(
	this IEnumerable<IGrouping<TKey, TElement>> source,
	TKey key1,
	TKey key2,
	TKey key3,
	Func<IEnumerable<TElement>, IEnumerable<TElement>, IEnumerable<TElement>, IEnumerable<IGrouping<TKey, TElement>>, TResult> resultSelector
)

Parameters

source
Type: System.Collections.GenericIEnumerableIGroupingTKey, TElement
The source sequence.
key1
Type: TKey
The first key to partition on.
key2
Type: TKey
The second key to partition on.
key3
Type: TKey
The third key to partition on.
resultSelector
Type: SystemFuncIEnumerableTElement, IEnumerableTElement, IEnumerableTElement, IEnumerableIGroupingTKey, TElement, TResult
Function that projects the result from elements of groups matching key1, key2 and key3 and those groups that do not (in the order in which they appear in source), passed as arguments.

Type Parameters

TKey
Type of keys in source groupings.
TElement
Type of elements in source groupings.
TResult
Type of the result.

Return Value

Type: TResult
The return value from resultSelector.

Usage Note

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