DocumentList<TDocument> Class
A list of documents.
Namespace
Statiq.Common
Interfaces
Base Types
  • object
Derived Types
graph BT Type-->Base0["object"] Type-.->Interface0["IReadOnlyList<TDocument>"] Type-.->Interface1["IReadOnlyCollection<TDocument>"] Type-.->Interface2["IEnumerable<TDocument>"] Type-.->Interface3["IEnumerable"] Type["DocumentList<TDocument>"] class Type type-node Derived0["FilteredDocumentList<TDocument>"]-->Type click Derived0 "/api/Statiq.Common/FilteredDocumentList_1"

Syntax

public class DocumentList<TDocument> : IReadOnlyList<TDocument>, IReadOnlyCollection<TDocument>, 
    IEnumerable<TDocument>, IEnumerable
    where TDocument : IDocument

Type Parameters

Name Description
TDocument The document type the list contains.

Constructors

Fields

Name Field Type Constant Value Summary
Empty DocumentList<TDocument>
static

Properties

Name Property Type Summary
Count int
this[int] TDocument
this[string[]] FilteredDocumentList<TDocument>
Returns documents with destination paths that satisfy the globbing pattern(s).

Methods

Name Return Value Summary
GetDestination(NormalizedPath) IDocument
Gets the first document in the list with the given destination path.
GetEnumerator() IEnumerator<TDocument>
GetRelativeSource(NormalizedPath) IDocument
Gets the first document in the list with the given relative source path (since source paths are generally absolute, this tests against the source path relative to it's input path).
GetSource(NormalizedPath) IDocument
Gets the first document in the list with the given source path (note that source paths are generally absolute).

Extension Methods

Name Value Summary
AsDestinationTree<TDocument>() DocumentPathTree<TDocument>
AsMetadataTree<TDocument>(string) DocumentMetadataTree<TDocument>
AsSourceTree<TDocument>() DocumentPathTree<TDocument>
Concat<TDocument>(TDocument) IEnumerable<T>
Contains<TDocument>(IReadOnlyList<TDocument>, EqualityComparer<TDocument>) bool
Contains<TDocument>(IReadOnlyList<TDocument>, int, EqualityComparer<TDocument>) bool
Contains<TDocument>(IReadOnlyList<TDocument>, int) bool
Contains<TDocument>(IReadOnlyList<TDocument>) bool
FilterDestinations<TDocument>(IEnumerable<string>, bool, string) FilteredDocumentList<TDocument>
Filters the documents by destination.
FilterDestinations<TDocument>(string[]) FilteredDocumentList<TDocument>
Filters the documents by destination.
FilterSources<TDocument>(IEnumerable<string>, bool, string) FilteredDocumentList<TDocument>
Filters the documents by source.
FilterSources<TDocument>(string[]) FilteredDocumentList<TDocument>
Filters the documents by source.
FirstOrDefaultDestination<TDocument>(IEnumerable<string>, bool, string) TDocument
FirstOrDefaultDestination<TDocument>(string[]) TDocument
FirstOrDefaultSource<TDocument>(IEnumerable<string>, bool, string) TDocument
FirstOrDefaultSource<TDocument>(string[]) TDocument
Flatten<TDocument>(bool, string) DocumentList<TDocument>
Flattens a tree structure.
Flatten<TDocument>(string, string) DocumentList<TDocument>
Flattens a tree structure.
Flatten<TDocument>(string) DocumentList<TDocument>
Flattens a tree structure.
GetNext<TDocument>(TDocument, IEqualityComparer<TDocument>) T
GetNext<TDocument>(TDocument) T
GetPrevious<TDocument>(TDocument, IEqualityComparer<TDocument>) T
GetPrevious<TDocument>(TDocument) T
GroupByMany<TDocument, TKey, TElement>(Func<TDocument, IEnumerable<TKey>>, Func<TDocument, TElement>, IEqualityComparer<TKey>) IEnumerable<IGrouping<TKey, TElement>>
Groups the elements of a sequence according to a specified key selector function that returns a sequence of keys. The keys are compared by using a comparer and each group's elements are projected by using a specified function.
GroupByMany<TDocument, TKey, TElement>(Func<TDocument, IEnumerable<TKey>>, Func<TDocument, TElement>) IEnumerable<IGrouping<TKey, TElement>>
Groups the elements of a sequence according to a specified key selector function that returns a sequence of keys and projects the elements for each group by using a specified function.
GroupByMany<TDocument, TKey>(Func<TDocument, IEnumerable<TKey>>, IEqualityComparer<TKey>) IEnumerable<IGrouping<TKey, TSource>>
Groups the elements of a sequence according to a specified key selector function that returns a sequence of keys and compares the keys by using a specified comparer.
GroupByMany<TDocument, TKey>(Func<TDocument, IEnumerable<TKey>>) IEnumerable<IGrouping<TKey, TSource>>
Groups the elements of a sequence according to a specified key selector function that returns a sequence of keys.
GroupByManyToMany<TDocument, TKey, TElement>(Func<TDocument, IEnumerable<TKey>>, Func<TDocument, IEnumerable<TElement>>, IEqualityComparer<TKey>) IEnumerable<IGrouping<TKey, TElement>>
Groups the elements of a sequence according to a specified key selector function that returns a sequence of keys. The keys are compared by using a comparer and each group's elements are projected by using a specified function that returns a sequence of elements.
GroupByManyToMany<TDocument, TKey, TElement>(Func<TDocument, IEnumerable<TKey>>, Func<TDocument, IEnumerable<TElement>>) IEnumerable<IGrouping<TKey, TElement>>
Groups the elements of a sequence according to a specified key selector function that returns a sequence of keys and projects the elements for each group by using a specified function that returns a sequence of elements.
IndexOf<TDocument>(IReadOnlyList<TDocument>, EqualityComparer<TDocument>) int
IndexOf<TDocument>(IReadOnlyList<TDocument>) int
ParallelForEachAsync<TDocument>(Func<TDocument, Task>, CancellationToken) Task
ParallelSelectAsync<TDocument, TResult>(Func<TDocument, Task<TResult>>, CancellationToken) Task<IEnumerable<TResult>>
Invokes an async selector in parallel.
ParallelSelectManyAsync<TDocument, TResult>(Func<TDocument, Task<IEnumerable<TResult>>>, CancellationToken) Task<IEnumerable<TResult>>
Invokes an async selector that returns multiple results in parallel.
ParallelWhereAsync<TDocument>(Func<TDocument, Task<bool>>, CancellationToken) Task<IEnumerable<TSource>>
RemoveTreePlaceholders<TDocument>(string) IEnumerable<TDocument>
Removes tree placeholder documents (this method will not flatten a tree).
StartsWith<TDocument>(IEnumerable<TDocument>, IEqualityComparer<TDocument>) bool
Determines whether the items starts with the specified values.
StartsWith<TDocument>(IEnumerable<TDocument>) bool
Determines whether the items starts with the specified values.
ThrowIfNull<DocumentList<TDocument>>(string) T
ToDocument<DocumentList<TDocument>>(IContentProvider) IDocument
ToDocument<DocumentList<TDocument>>(IEnumerable<KeyValuePair<string, object>>, IContentProvider) IDocument
ToDocument<DocumentList<TDocument>>(NormalizedPath, IContentProvider) IDocument
ToDocument<DocumentList<TDocument>>(NormalizedPath, IEnumerable<KeyValuePair<string, object>>, IContentProvider) IDocument
ToDocument<DocumentList<TDocument>>(NormalizedPath, NormalizedPath, IContentProvider) IDocument
ToDocument<DocumentList<TDocument>>(NormalizedPath, NormalizedPath, IEnumerable<KeyValuePair<string, object>>, IContentProvider) IDocument
ToDocumentList<TDocument>() DocumentList<TDocument>
ToDocuments<TDocument>(Func<TDocument, IContentProvider>) IEnumerable<IDocument>
ToDocuments<TDocument>(Func<TDocument, IEnumerable<KeyValuePair<string, object>>>, Func<TDocument, IContentProvider>) IEnumerable<IDocument>
ToDocuments<TDocument>(Func<TDocument, NormalizedPath>, Func<TDocument, IContentProvider>) IEnumerable<IDocument>
ToDocuments<TDocument>(Func<TDocument, NormalizedPath>, Func<TDocument, IEnumerable<KeyValuePair<string, object>>>, Func<TDocument, IContentProvider>) IEnumerable<IDocument>
ToDocuments<TDocument>(Func<TDocument, NormalizedPath>, Func<TDocument, NormalizedPath>, Func<TDocument, IContentProvider>) IEnumerable<IDocument>
ToDocuments<TDocument>(Func<TDocument, NormalizedPath>, Func<TDocument, NormalizedPath>, Func<TDocument, IEnumerable<KeyValuePair<string, object>>>, Func<TDocument, IContentProvider>) IEnumerable<IDocument>
ToImmutableDocumentArray<TDocument>() ImmutableArray<TDocument>
Creates an immutable array from the specified document collection and removes null items.
ToLookupMany<TDocument, TKey, TElement>(Func<TDocument, IEnumerable<TKey>>, Func<TDocument, TElement>, IEqualityComparer<TKey>) ILookup<TKey, TElement>
Creates a lookup from a sequence according to a specified key selector function that returns a sequence of keys. The keys are compared by using a comparer and each group's elements are projected by using a specified function.
ToLookupMany<TDocument, TKey, TElement>(Func<TDocument, IEnumerable<TKey>>, Func<TDocument, TElement>) ILookup<TKey, TElement>
Creates a lookup from a sequence according to a specified key selector function that returns a sequence of keys and projects the elements for each group by using a specified function.
ToLookupMany<TDocument, TKey>(Func<TDocument, IEnumerable<TKey>>, IEqualityComparer<TKey>) ILookup<TKey, TSource>
Creates a lookup from a sequence according to a specified key selector function that returns a sequence of keys and compares the keys by using a specified comparer.
ToLookupMany<TDocument, TKey>(Func<TDocument, IEnumerable<TKey>>) ILookup<TKey, TSource>
Creates a lookup from a sequence according to a specified key selector function that returns a sequence of keys.
ToLookupManyToMany<TDocument, TKey, TElement>(Func<TDocument, IEnumerable<TKey>>, Func<TDocument, IEnumerable<TElement>>, IEqualityComparer<TKey>) ILookup<TKey, TElement>
Creates a lookup from a sequence according to a specified key selector function that returns a sequence of keys. The keys are compared by using a comparer and each group's elements are projected by using a specified function that returns a sequence of elements.
ToLookupManyToMany<TDocument, TKey, TElement>(Func<TDocument, IEnumerable<TKey>>, Func<TDocument, IEnumerable<TElement>>) ILookup<TKey, TElement>
Creates a lookup from a sequence according to a specified key selector function that returns a sequence of keys and projects the elements for each group by using a specified function that returns a sequence of elements.
ToStringTable<TDocument>(string[], Func<TDocument, object>[]) string
WhereContainsAllKeys<TDocument>(string[]) DocumentList<TDocument>
Returns all documents that contain all of the specified metadata keys.
WhereContainsAnyKeys<TDocument>(string[]) DocumentList<TDocument>
Returns all documents that contain any of the specified metadata keys.
WhereContainsKey<TDocument>(string) DocumentList<TDocument>
Returns all documents that contain the specified metadata key.