Gets the value for the specified key converted to a
IReadOnlyList<IDocument>
. This method never throws an exception.
It will return null if the key is not found and an empty list if the key is found but contains no items that can be converted to
IDocument
.
Syntax
public static IEnumerable<IDocument> GetDocuments(this IMetadata metadata, string key, IReadOnlyList<IDocument> defaultValue = null)
Parameters
Name |
Type |
Description |
metadata |
IMetadata |
The metadata instance. |
key |
string |
The key of the documents to get. |
defaultValue |
IReadOnlyList<IDocument> |
The default value to use if the key is not found or cannot be converted to a document list. |
Return Value
Type |
Description |
IEnumerable<IDocument> |
The value for the specified key converted to a list or null. |