Click or drag to resize
JsonObjectGetOrAddTJsonValue Method
Gets the member stored under given key and casts it to desired type. If key does not exist specified value is stored as a new member.

Namespace: Dextronet.Jsonie
Assembly: Dextronet.Jsonie (in Dextronet.Jsonie.dll) Version: 1.0.0.0
Syntax
public TJsonValue GetOrAdd<TJsonValue>(
	string key,
	TJsonValue addValue
)
where TJsonValue : JsonValue

Parameters

key
Type: SystemString
The key of the member to get.
addValue
Type: TJsonValue
The value to add if specified member does not exist.

Type Parameters

TJsonValue
Type of the value to get.

Return Value

Type: TJsonValue
The value stored under given key casted to the TJsonValue.
Exceptions
ExceptionCondition
ArgumentNullExceptionkey is Nothing.
InvalidCastExceptionIf property with given key exist and is not of TJsonValue type.
See Also