Interface IIronLedgerSerializer
- Namespace
- Tudormobile.IronLedgerLib
- Assembly
- Tudormobile.IronLedgerLib.dll
Defines a serializer for IronLedger types.
public interface IIronLedgerSerializer
Remarks
Implementations can use any serialization format (JSON, XML, binary, etc.). The default implementation uses System.Text.Json.
Properties
ContentType
Gets the MIME content type produced by this serializer (e.g. application/json).
string ContentType { get; }
Property Value
Methods
Deserialize<T>(string)
Deserializes a string representation to an object.
T? Deserialize<T>(string data)
Parameters
datastringThe string representation to deserialize.
Returns
- T
The deserialized object. Some implementations may return null if deserialization fails, while others may throw an exception (for example, when the input is invalid for the chosen serialization format).
Type Parameters
TThe type of object to deserialize.
Serialize<T>(T)
Serializes an object to a string representation.
string Serialize<T>(T value)
Parameters
valueTThe value to serialize.
Returns
- string
A string representation of the object.
Type Parameters
TThe type of object to serialize.