FilterSources<TDocument>(IEnumerable<TDocument>, IEnumerable<string>, bool, string) Method
Filters the documents by source.
Containing Type


public static FilteredDocumentList<TDocument> FilterSources<TDocument>(this IEnumerable<TDocument> documents, IEnumerable<string> patterns, bool flatten = true, string childrenKey = "Children") 
    where TDocument : IDocument


This module filters documents using "or" logic. If you want to also apply "and" conditions, chain additional calls.

Type Parameters

Name Description
TDocument The document type.


Name Type Description
documents IEnumerable<TDocument> The documents to filter.
patterns IEnumerable<string> The globbing pattern(s) to match.
flatten bool true to flatten the documents, false otherwise. If false only the top-level sequence (usually the parent-most documents) will be filtered.
childrenKey string The metadata key that contains the children or null to flatten documents in all metadata keys. This parameter has no effect if flatten is false.

Return Value

Type Description
FilteredDocumentList<TDocument> The documents that match the globbing pattern(s).