Summary
Gets the value for the specified key converted to a bool. This method never throws an exception. It will return the specified
default value if the key is not found.
Syntax
public static bool Bool(this IMetadata metadata, string key, bool defaultValue = false)
Parameters
Name |
Type |
Description |
metadata |
IMetadata |
The metadata containing the value. |
key |
string |
The key of the value to get. |
defaultValue |
bool |
The default value to use if the key is not found or cannot be converted to a bool. |
Return Value
Type |
Description |
bool |
The value for the specified key converted to a bool or the specified default value. |