SerializationModule
PackageFCQRS.Serialization
Provides JSON serialization and deserialization functionality for FCQRS.
Summary
| Name | Signature | Synopsis |
|---|---|---|
| jsonOptions | jsonOptions | Default JSON serializer options configured for F# types, C# polymorphic types, and C# 15 discriminated unions. |
| encode | encode obj | Serializes an object to a JSON string. |
| decode | decode json | Deserializes a JSON element to a strongly-typed object. |
| encodeToBytes | encodeToBytes obj | Serializes an object to a UTF-8 byte array. |
| decodeFromBytes | decodeFromBytes json | Deserializes a byte array to a strongly-typed object. |
Default JSON serializer options configured for F# types, C# polymorphic
types, and C# 15 discriminated unions.
Returns
JsonSerializerOptions
Serializes an object to a JSON string.
Parameters
| Name | Type | Description |
|---|---|---|
| obj | 'a | The object to serialize. |
Returns
string
Deserializes a JSON element to a strongly-typed object.
Parameters
| Name | Type | Description |
|---|---|---|
| json | JsonElement | The JSON element to deserialize. |
Returns
'T
Serializes an object to a UTF-8 byte array.
Parameters
| Name | Type | Description |
|---|---|---|
| obj | 'a | The object to serialize. |
Returns
byte[]