FromDocument<TValue>(string, TValue) Method
Creates a config value by getting the metadata value of a specified key from a document.
Namespace
Statiq.Common
Containing Type
Config

Syntax

public static Config<TValue> FromDocument<TValue>(string key, TValue defaultValue)

Type Parameters

Name Description
TValue The type of config value.

Parameters

Name Type Description
key string The metadata key to get the value from.
defaultValue TValue The default value to use if the key cannot be found, is null, or cannot be converted to TValue.

Return Value

Type Description
Config<TValue> A config object.