Description
Service Fabric using the DataContractSerializer does not currently support serialization and deserialization of .NET 6.0 DateOnly type used in dto's, parameters or return values. Can you advise how I can add this support? I'm not sure how to do this with the DataContractSerializer.
I know how to add this support using custom converters when using a json serializer (either Newtonsoft or System.Text.Json). So I looked at the example here Use custom serialization with a remoting wrapped message for how I might replace the DataContractSerializer with a json serializer.
A couple of issues:
I use v2 remoting but not the interface compatible v2.1 as I cannot use wrapped messages. I tried using v2.1 with wrapped messages but it does not work for some reason. Perhaps it does not work because I already customize the client and listener so that I can add custom headers containing context to the transport .
I want to use System.Text.Json and not Newtonsoft. How should I implement polymorphic deserialization which needs to be implemented using a custom converter as discussed here Support polymorphic deserialization, when I'm not directly (de)serializing my dto's / parameters / return values, but I'm (de)serializing a IServiceRemotingRequestMessageBody or IServiceRemotingResponseMessageBody. I will need to serialize the type information.
Specifically when using actors I may need to do something similar to the ActorDataContractSurrogate and ActorReference used by ActorRemotingDataContractSerializationProvider when using a json serializer