GroupByExtensions.

GroupByManyToMany<TKey, TElement>(IEnumerable<IDocument>, string, string, IEqualityComparer<TKey>) Method

Summary

Groups the elements of a sequence of documents according to a specified metadata key that contains a sequence of keys. The keys are compared by using a comparer and each group's elements are obtained by using a specified metadata key.
Assembly
Wyam.Common.dll
Namespace
Wyam.Common.Documents
Containing Type
GroupByExtensions

Syntax

public static IEnumerable<IGrouping<TKey, TElement>> GroupByManyToMany<TKey, TElement>(this IEnumerable<IDocument> documents, string keyMetadataKey, string elementMetadataKey, IEqualityComparer<TKey> comparer)

Type Parameters

Name Description
TKey The type of the key.
TElement The type of the element.

Parameters

Name Type Description
documents IEnumerable<IDocument> The documents.
keyMetadataKey string The key metadata key.
elementMetadataKey string The element metadata key.
comparer IEqualityComparer<TKey> The comparer.

Return Value

Type Description
IEnumerable<IGrouping<TKey, TElement>> A sequence of groups.
GitHub