CascadeJsonSerialization handles JSON serialization and deserialization within the Cascade framework. Provides utilities to serialize and deserialize model objects while considering configurable options to ignore certain properties based on defined conditions. Implemented using System.Text.Json.
More...
|
| | CascadeJsonSerialization (Boolean ignoreUnderscoreProperties=true, Boolean ignoreAssociations=true) |
| | CascadeJsonSerialization Constructor.
|
| ImmutableDictionary< string, object?> | DeserializeImmutableDictionary (string source) |
| | Deserializes a JSON string into an immutable dictionary.
|
| Dictionary< string, object?> | DeserializeDictionaryOfNormalTypes (string source) |
| | Deserializes a JSON string into a dictionary of normal types ie int, string, bool, double Vs eg. the JsonEntity instances returned by System.Text.Json.
|
| Dictionary< string, object?> | DeserializeDictionaryOfNormalTypes (JsonElement source) |
| | Deserializes a JSON element into a dictionary of normal types ie int, string, bool, double Vs eg. the JsonEntity instances returned by System.Text.Json.
|
| object | DeserializeType (Type type, string source) |
| | Deserializes a JSON string into a specific object type.
|
| object | DeserializeType (Type type, JsonElement source) |
| | Deserializes a JSON element into a specific object type.
|
| T | DeserializeType< T > (string? source) |
| | Deserializes a JSON string into a specific generic type.
|
| T | DeserializeType< T > (JsonElement element) |
| | Deserializes a JSON element into a specific generic type.
|
| JsonElement | DeserializeElement (string? source) |
| | Deserializes a JSON string into a JsonElement.
|
| IEnumerable< M > | DeserializeEnumerable< M > (IEnumerable< JsonElement > elements) |
| | Deserializes an IEnumerable of JsonElements into a collection of type M.
|
| string? | Serialize (object value) |
| | Serializes an object into a JSON string.
|
| JsonNode | SerializeToNode (object value) |
| | Serializes an object into a JsonNode.
|
| JsonElement | SerializeToElement (object value) |
| | Serializes an object to a JsonElement.
|
CascadeJsonSerialization handles JSON serialization and deserialization within the Cascade framework. Provides utilities to serialize and deserialize model objects while considering configurable options to ignore certain properties based on defined conditions. Implemented using System.Text.Json.
◆ CascadeJsonSerialization()
| Buzzware.Cascade.CascadeJsonSerialization.CascadeJsonSerialization |
( |
Boolean | ignoreUnderscoreProperties = true, |
|
|
Boolean | ignoreAssociations = true ) |
|
inline |
CascadeJsonSerialization Constructor.
- Parameters
-
| ignoreUnderscoreProperties | Specifies whether properties starting with an underscore should be ignored during serialization. |
| ignoreAssociations | Specifies whether association properties should be ignored during serialization. |
◆ DeserializeDictionaryOfNormalTypes() [1/2]
| Dictionary< string, object?> Buzzware.Cascade.CascadeJsonSerialization.DeserializeDictionaryOfNormalTypes |
( |
JsonElement | source | ) |
|
|
inline |
Deserializes a JSON element into a dictionary of normal types ie int, string, bool, double Vs eg. the JsonEntity instances returned by System.Text.Json.
- Parameters
-
| source | The JSON element to be deserialized. |
- Returns
- A dictionary of string keys and object values.
◆ DeserializeDictionaryOfNormalTypes() [2/2]
| Dictionary< string, object?> Buzzware.Cascade.CascadeJsonSerialization.DeserializeDictionaryOfNormalTypes |
( |
string | source | ) |
|
|
inline |
Deserializes a JSON string into a dictionary of normal types ie int, string, bool, double Vs eg. the JsonEntity instances returned by System.Text.Json.
- Parameters
-
| source | The JSON string to be deserialized. |
- Returns
- A dictionary of string keys and object values.
◆ DeserializeElement()
| JsonElement Buzzware.Cascade.CascadeJsonSerialization.DeserializeElement |
( |
string? | source | ) |
|
|
inline |
Deserializes a JSON string into a JsonElement.
- Parameters
-
| source | The JSON string to be deserialized. |
- Returns
- A JsonElement representing the deserialized JSON.
◆ DeserializeEnumerable< M >()
| IEnumerable< M > Buzzware.Cascade.CascadeJsonSerialization.DeserializeEnumerable< M > |
( |
IEnumerable< JsonElement > | elements | ) |
|
|
inline |
Deserializes an IEnumerable of JsonElements into a collection of type M.
- Template Parameters
-
| M | The type of objects to be deserialized into, constrained to class types. |
- Parameters
-
| elements | The collection of JsonElements to be deserialized. |
- Returns
- An IEnumerable of deserialized type M objects.
◆ DeserializeImmutableDictionary()
| ImmutableDictionary< string, object?> Buzzware.Cascade.CascadeJsonSerialization.DeserializeImmutableDictionary |
( |
string | source | ) |
|
|
inline |
Deserializes a JSON string into an immutable dictionary.
- Parameters
-
| source | The JSON string to be deserialized. |
- Returns
- An immutable dictionary of string keys and object values.
◆ DeserializeType() [1/2]
| object Buzzware.Cascade.CascadeJsonSerialization.DeserializeType |
( |
Type | type, |
|
|
JsonElement | source ) |
|
inline |
Deserializes a JSON element into a specific object type.
- Parameters
-
| type | The Type into which the JSON should be deserialized. |
| source | The JSON element to be deserialized. |
- Returns
- The deserialized object of specified type.
◆ DeserializeType() [2/2]
| object Buzzware.Cascade.CascadeJsonSerialization.DeserializeType |
( |
Type | type, |
|
|
string | source ) |
|
inline |
Deserializes a JSON string into a specific object type.
- Parameters
-
| type | The Type into which the JSON should be deserialized. |
| source | The JSON string to be deserialized. |
- Returns
- The deserialized object of specified type.
◆ DeserializeType< T >() [1/2]
Deserializes a JSON element into a specific generic type.
- Template Parameters
-
| T | The type into which the JSON should be deserialized. |
- Parameters
-
| element | The JSON element to be deserialized. |
- Returns
- The deserialized object of type T.
◆ DeserializeType< T >() [2/2]
Deserializes a JSON string into a specific generic type.
- Template Parameters
-
| T | The type into which the JSON should be deserialized. |
- Parameters
-
| source | The JSON string to be deserialized. |
- Returns
- The deserialized object of type T.
◆ Serialize()
| string? Buzzware.Cascade.CascadeJsonSerialization.Serialize |
( |
object | value | ) |
|
|
inline |
Serializes an object into a JSON string.
- Parameters
-
| value | The object to be serialized. |
- Returns
- A JSON string representation of the object.
◆ SerializeToElement()
| JsonElement Buzzware.Cascade.CascadeJsonSerialization.SerializeToElement |
( |
object | value | ) |
|
|
inline |
Serializes an object to a JsonElement.
- Parameters
-
| value | The object to be serialized. |
- Returns
- A JsonElement representing the serialized object.
◆ SerializeToNode()
| JsonNode Buzzware.Cascade.CascadeJsonSerialization.SerializeToNode |
( |
object | value | ) |
|
|
inline |
Serializes an object into a JsonNode.
- Parameters
-
| value | The object to be serialized. |
- Returns
- A JsonNode representing the serialized object.
The documentation for this class was generated from the following file:
- Buzzware.Cascade/utilities/CascadeJsonSerialization.cs