MetadataConversionExtensions.

String(IMetadata, string, Func<string, string>, string) Method

Summary

Formats a string value if it exists in the metadata, otherwise returns a default value.

Syntax

public static string String(this IMetadata metadata, string key, Func<string, string> formatFunc, string defaultValue = null)

Parameters

Name Type Description
metadata IMetadata The metadata containing the value.
key string The key of the value to get.
formatFunc Func<string, string> A formatting function to apply to the string value of the specified key.
defaultValue string The default value to use if the key is not found.

Return Value

Type Description
string The formatted value of the specified key if it exists or the specified default value.
GitHub