Gets the value for the specified key converted to a
DocumentList<TDocument>
. This method never throws an exception.
It will return an empty list if the key is not found or if the key is found but contains no items that can be converted to the specified document type.
- Namespace
- Statiq
.Common - Containing Type
- I
Metadata Conversion Extensions
Syntax
public static DocumentList<TDocument> GetDocumentList<TDocument>(this IMetadata metadata, string key)
where TDocument : IDocument
Type Parameters
Name | Description |
---|---|
TDocument |
Parameters
Name | Type | Description |
---|---|---|
metadata | IMetadata | The metadata instance. |
key | string | The key of the documents to get. |
Return Value
Type | Description |
---|---|
DocumentList |
The value for the specified key converted to a list or null. |