Gets the value associated with the specified key as a dynamic object. This is equivalent
to calling as dynamic
to cast the value.
Syntax
public static dynamic GetDynamic(this IMetadata metadata, string key, object defaultValue = null)
Parameters
Name |
Type |
Description |
metadata |
IMetadata |
The metadata instance. |
key |
string |
The key of the value to get. |
defaultValue |
object |
The default value to use if either the key is not found or the
underlying value is null (since the dynamic runtime binder can't bind null values). |
Return Value
Type |
Description |
dynamic |
A dynamic value for the specific key or default value. |