Returns a reference to an object held in the dictionary, or the defaultValue if the key cannot be found.
Namespace: Facilita.Fc.RuntimeAssembly: fc_clr (in fc_clr.dll) Version: 9.5.8.37
T Get<T>(
string key,
T defaultValue
)
T Get<T>(
string key,
T defaultValue
)
Parameters
- key
- Type: System String
The key to be looked up in the dictionary.
- defaultValue
- Type: T
The value to return if the key is not present in the dictionary.
- T
- The type of value to get
Return Value
An object value held in the dictionary.
Default data warning:
When called from a VU script, if the
defaultValue is returned then a message
is also written to the VU Event Log. This feature helps highlight problems with data bindings
when data is expected to come from a data source, but the default value is returned instead.
An example of the message entry in the Event Log:
Type | ID | Info |
---|
Message | Default data warning | No value found for key: myObject, using default value instead: abcd1234 |
To turn this feature off, go to the
Test view in
eggPlant Performance Studio and uncheck the option "Enable default
data warnings" on the
Data tab.
The following example demonstrates getting an object from the dictionary.
object obj = Get("employee", new Employee());
object obj = Get("employee", new Employee());