We have the following Delphi code and need an equivalent way to override the C# JsonSerializer.
TOrionJSONMessage = class(TROJSONMessage)
protected
function CreateSerializer: TROSerializer; override;
public
constructor Create(aOwner: TComponent); override;
end;
We have tried to subclass the JsonMessage class but it isn’t possible to plug in a custom serializer due to the following method being private in the base class:
private void IntInitializeMessage()
{
this.SerializerInstance = new JsonSerializer(this);
this.fRootObject = new JsonObject();
this.fRootObject.Add(new JsonString("version"), new JsonString("1.1"));
this.CurrentObject = this.RootObject;
}