Appearance
TryDeserialize Method
Definition
- Namespace:
JASE.Serializers - Assembly:
JASE.Serializers.dll
Overloads
| Name | Description |
|---|---|
bool TryDeserialize(ReadOnlySpan<byte> json, out T output, JsonSerializerOptions options = null) | Attempts to deserialize JSON bytes into a T without throwing. |
bool TryDeserialize(string json, out T output, JsonSerializerOptions options = null) | Attempts to deserialize JSON into a T without throwing. |
bool TryDeserialize(byte[] json, Type type, out object output, JsonSerializerOptions options = null) | Deserialize a JSON string into an object type |
bool TryDeserialize(string json, Type type, out object output, JsonSerializerOptions options = null) | Deserialize a JSON string into an object type |
bool TryDeserialize(byte[] json, Type type, out object output, JsonSerializerOptions options = null)
csharp
bool TryDeserialize(byte[] json, Type type, out object output, JsonSerializerOptions options = null)Deserialize a JSON string into an object type
Returns
Object
bool TryDeserialize(string json, Type type, out object output, JsonSerializerOptions options = null)
csharp
bool TryDeserialize(string json, Type type, out object output, JsonSerializerOptions options = null)Deserialize a JSON string into an object type
Returns
Object
bool TryDeserialize(ReadOnlySpan<byte> json, out T output, JsonSerializerOptions options = null)
csharp
bool TryDeserialize(ReadOnlySpan<byte> json, out T output, JsonSerializerOptions options = null)Attempts to deserialize JSON bytes into a T without throwing.
Parameters
| Name | Description |
|---|---|
json | The JSON byte array to parse. If null/empty, returns false. |
options | Optional JsonSerializerOptions; if null, uses library defaults. |
output | The deserialized value when the method returns true; otherwise the default for T. |
Returns
true on success; otherwise false.
bool TryDeserialize(string json, out T output, JsonSerializerOptions options = null)
csharp
bool TryDeserialize(string json, out T output, JsonSerializerOptions options = null)Attempts to deserialize JSON into a T without throwing.
Parameters
| Name | Description |
|---|---|
json | The JSON string to parse. If null/empty, returns false. |
options | Optional JsonSerializerOptions; if null, uses library defaults. |
output | The deserialized value when the method returns true; otherwise the default for T. |
Returns
true on success; otherwise false.