JsonReadOnlyProxyDictionary<TValue, TProxy>
Namespace: SnowBank.Data.Json · struct
Implements: IReadOnlyDictionary<string, TProxy>, IEnumerable<KeyValuePair<string, TProxy>>, IEnumerable, IReadOnlyCollection<KeyValuePair<string, TProxy>>, IJsonSerializable, IJsonPackable
Wraps a JsonObject into a typed read-only proxy that emulates a dictionary of elements of type TValue
Constructors
JsonReadOnlyProxyDictionary<TValue, TProxy>
JsonReadOnlyProxyDictionary<TValue, TProxy>(ObservableJsonValue value)
Properties
Count
int Count { get; }
Item
TProxy Item { get; }
TProxy Item { get; }
Keys
IEnumerable<string> Keys { get; }
Values
IEnumerable<TProxy> Values { get; }
Methods
ContainsKey
bool ContainsKey(string key)
Exists
bool Exists()
Tests if the object is present.
Returns: false if the wrapped JSON value is null or empty; otherwise, true.
GetEnumerator
IEnumerator<KeyValuePair<string, TProxy>> GetEnumerator()
IsNullOrEmpty
bool IsNullOrEmpty()
Tests if the object is null, missing, or empty.
Returns: true if the wrapped JSON value is null, missing or an empty object; otherwise, false.
This can return false if the wrapped value is an empty object, or another type, like an array, string literal, etc...
IsNullOrMissing
bool IsNullOrMissing()
Tests if the object is null or missing.
Returns: true if the wrapped JSON value is null or missing; otherwise, false.
This can return false if the wrapped value is another type, like an array, string literal, etc...
IsObject
bool IsObject()
Tests if the wrapped value is a valid JSON Object.
Returns: true if the wrapped JSON value is a non-null Object; otherwise, false
This can be used to protect against malformed JSON document that would have a different type (array, string literal, ...).
IsObjectOrMissing
bool IsObjectOrMissing()
Tests if the wrapped value is a valid JSON Object, or is null-or-missing.
Returns: true if the wrapped JSON value either null-or-missing, or an Object; otherwise, false
This can be used to protect against malformed JSON document that would have a different type (array, string literal, ...).
ToDictionary
Dictionary<string, TValue> ToDictionary()
ToJsonValue
JsonValue ToJsonValue()
ToString
string ToString()
TryGetValue
bool TryGetValue(string key, out TProxy value)