Class JsonData
Implements
Inherited Members
Namespace: Inttegro
Assembly: Inttegro.dll
Syntax
[JsonConverter(typeof(JsonDataJsonConverter))]
public sealed class JsonData : IReadOnlyDictionary<string, JsonElement>, IReadOnlyCollection<KeyValuePair<string, JsonElement>>, IEnumerable<KeyValuePair<string, JsonElement>>, IEnumerable
Properties
| Edit this page View SourceCount
Gets the number of elements in the collection.
Declaration
public int Count { get; }
Property Value
| Type | Description |
|---|---|
| int | The number of elements in the collection. |
this[string]
Gets the element that has the specified key in the read-only dictionary.
Declaration
public JsonElement this[string key] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The key to locate. |
Property Value
| Type | Description |
|---|---|
| JsonElement | The element that has the specified key in the read-only dictionary. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException |
|
| KeyNotFoundException | The property is retrieved and |
Keys
Gets an enumerable collection that contains the keys in the read-only dictionary.
Declaration
public IEnumerable<string> Keys { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<string> | An enumerable collection that contains the keys in the read-only dictionary. |
Values
Gets an enumerable collection that contains the values in the read-only dictionary.
Declaration
public IEnumerable<JsonElement> Values { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<JsonElement> | An enumerable collection that contains the values in the read-only dictionary. |
Methods
| Edit this page View SourceContainsKey(string)
Determines whether the read-only dictionary contains an element that has the specified key.
Declaration
public bool ContainsKey(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The key to locate. |
Returns
| Type | Description |
|---|---|
| bool | true if the read-only dictionary contains an element that has the specified key; otherwise, false. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException |
|
GetEnumerator()
Returns an enumerator that iterates through the collection.
Declaration
public IEnumerator<KeyValuePair<string, JsonElement>> GetEnumerator()
Returns
| Type | Description |
|---|---|
| IEnumerator<KeyValuePair<string, JsonElement>> | An enumerator that can be used to iterate through the collection. |
Get<T>(string)
Declaration
public T? Get<T>(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key |
Returns
| Type | Description |
|---|---|
| T |
Type Parameters
| Name | Description |
|---|---|
| T |
Remove(string)
Declaration
public bool Remove(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key |
Returns
| Type | Description |
|---|---|
| bool |
Set<T>(string, T)
Declaration
public JsonData Set<T>(string key, T value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | |
| T | value |
Returns
| Type | Description |
|---|---|
| JsonData |
Type Parameters
| Name | Description |
|---|---|
| T |
TryGetValue(string, out JsonElement)
Gets the value that is associated with the specified key.
Declaration
public bool TryGetValue(string key, out JsonElement value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The key to locate. |
| JsonElement | value | When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the |
Returns
| Type | Description |
|---|---|
| bool | true if the object that implements the IReadOnlyDictionary<TKey, TValue> interface contains an element that has the specified key; otherwise, false. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException |
|