JsonObjectGetOrDefaultTJsonValue Method (String, TJsonValue) |
Gets value stored under given key and casts it to desired type. If not such member exists
than defaultValue is returned.
Namespace: Dextronet.JsonieAssembly: Dextronet.Jsonie (in Dextronet.Jsonie.dll) Version: 1.0.0.0
Syntax public TJsonValue GetOrDefault<TJsonValue>(
string key,
TJsonValue defaultValue = null
)
where TJsonValue : JsonValue
Public Function GetOrDefault(Of TJsonValue As JsonValue) (
key As String,
Optional defaultValue As TJsonValue = Nothing
) As TJsonValue
Parameters
- key
- Type: SystemString
The key under which is object stored. - defaultValue (Optional)
- Type: TJsonValue
Default value returned in case no such member exists.
Type Parameters
- TJsonValue
- Desired type of value.
Return Value
Type:
TJsonValueValue stored under given key casted to TJsonValue.
Exceptions See Also