Consider the following code, which implements MessagePack serialization:
MessagePackSerializer.Serialize(value, Options);
For some reason, when value
is defined as T
, MessagePack includes the type information, however…
MessagePackSerializer.Serialize((object?)value, Options);
…now that I have cast (object?)value
, MessagePack omits the type information.
Why is this?