GroupByExtensions.

GroupBy<TKey>(IEnumerable<IDocument>, string) Method

Summary

Groups the elements of a sequence of documents using the values of a specified metadata key. If a document does not contain the specified metadata key, it is not included in the result set.
Assembly
Wyam.Common.dll
Namespace
Wyam.Common.Documents
Containing Type
GroupByExtensions

Syntax

public static IEnumerable<IGrouping<TKey, IDocument>> GroupBy<TKey>(this IEnumerable<IDocument> documents, string keyMetadataKey)

Type Parameters

Name Description
TKey The type of the key.

Parameters

Name Type Description
documents IEnumerable<IDocument> The documents.
keyMetadataKey string The key metadata key.

Return Value

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