MetadataConversionExtensions.

Document(IMetadata, string, IDocument) Method

Summary

Gets the value for the specified key converted to a Wyam.Common.Documents.IDocument. This method never throws an exception. It will return null if the key is not found.

Syntax

public static IDocument Document(this IMetadata metadata, string key, IDocument defaultValue = null)

Parameters

Name Type Description
metadata IMetadata The metadata containing the value.
key string The key of the document to get.
defaultValue IDocument The default value to use if the key is not found or cannot be converted to a document.

Return Value

Type Description
IDocument The value for the specified key converted to a string or null.
GitHub