Get<T>(IMetadata, string) Method
Gets the value for the specified key converted to the specified type. This method never throws an exception. It will return default(T) if the key is not found, is null, or the value cannot be converted to T.
Namespace
Statiq.Common
Containing Type
IMetadataGetExtensions

Syntax

public static T Get<T>(this IMetadata metadata, string key)

Type Parameters

Name Description
T The desired return type.

Parameters

Name Type Description
metadata IMetadata The metadata instance.
key string The key of the value to get.

Return Value

Type Description
T The value for the specified key converted to type T or default(T) if the key is not found, is null, or cannot be converted to type T.