PartitionExtensionPartitionTKey, TElement, TResult(IEnumerableIGroupingTKey, TElement, TKey, TKey, TKey, IEqualityComparerTKey, FuncIEnumerableTElement, IEnumerableTElement, IEnumerableTElement, IEnumerableIGroupingTKey, TElement, TResult) Method
Partitions a grouping and projects a result from elements groups
matching a set of three keys and those groups that do not. An
additional parameter specifies how to compare keys for equality.
Namespace: MoreLinq.ExtensionsAssembly: MoreLinq (in MoreLinq.dll) Version: 3.4.0+b99a6a8cc504caf2d48372fe54a2f8116c59cd0c
public static TResult Partition<TKey, TElement, TResult>(
this IEnumerable<IGrouping<TKey, TElement>> source,
TKey key1,
TKey key2,
TKey key3,
IEqualityComparer<TKey>? comparer,
Func<IEnumerable<TElement>, IEnumerable<TElement>, IEnumerable<TElement>, IEnumerable<IGrouping<TKey, TElement>>, TResult> resultSelector
)
<ExtensionAttribute>
Public Shared Function Partition(Of TKey, TElement, TResult) (
source As IEnumerable(Of IGrouping(Of TKey, TElement)),
key1 As TKey,
key2 As TKey,
key3 As TKey,
comparer As IEqualityComparer(Of TKey),
resultSelector As Func(Of IEnumerable(Of TElement), IEnumerable(Of TElement), IEnumerable(Of TElement), IEnumerable(Of IGrouping(Of TKey, TElement)), TResult)
) As TResult
public:
[ExtensionAttribute]
generic<typename TKey, typename TElement, typename TResult>
static TResult Partition(
IEnumerable<IGrouping<TKey, TElement>^>^ source,
TKey key1,
TKey key2,
TKey key3,
IEqualityComparer<TKey>^ comparer,
Func<IEnumerable<TElement>^, IEnumerable<TElement>^, IEnumerable<TElement>^, IEnumerable<IGrouping<TKey, TElement>^>^, TResult>^ resultSelector
)
[<ExtensionAttribute>]
static member Partition :
source : IEnumerable<IGrouping<'TKey, 'TElement>> *
key1 : 'TKey *
key2 : 'TKey *
key3 : 'TKey *
comparer : IEqualityComparer<'TKey> *
resultSelector : Func<IEnumerable<'TElement>, IEnumerable<'TElement>, IEnumerable<'TElement>, IEnumerable<IGrouping<'TKey, 'TElement>>, 'TResult> -> 'TResult
- source IEnumerableIGroupingTKey, TElement
- The source sequence.
- key1 TKey
- The first key to partition on.
- key2 TKey
- The second key to partition on.
- key3 TKey
- The third key to partition on.
- comparer IEqualityComparerTKey
- The comparer for keys.
- resultSelector FuncIEnumerableTElement, 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.
- TKey
- Type of keys in source groupings.
- TElement
- Type of elements in source groupings.
- TResult
- Type of the result.
TResult
The return value from
resultSelector.
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).