MetadataConversionExtensions.

String(IMetadata, string, string) Method

Summary

Gets the value for the specified key converted to a string. This method never throws an exception. It will return the specified default value if the key is not found.

Syntax

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

Parameters

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

Return Value

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