ToLookupExtensions.

ToLookup<TKey, TElement>(IEnumerable<IDocument>, string, string) Method

Summary

Creates a lookup from a sequence of documents and the values of a specified metadata key using the value of the specified element metadata for the elements of the lookup. If a document does not contain the specified key or element metadata keys, it is not included in the result set.
Assembly
Wyam.Common.dll
Namespace
Wyam.Common.Documents
Containing Type
ToLookupExtensions

Syntax

public static ILookup<TKey, TElement> ToLookup<TKey, TElement>(this IEnumerable<IDocument> documents, string keyMetadataKey, string elementMetadataKey)

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.

Return Value

Type Description
ILookup<TKey, TElement> A lookup.
GitHub