Interface IMessageSerializer
Defines a strategy for serializing and deserializing message bodies.
Implementations handle specific formats (JSON, Protobuf, MessagePack, etc.).
public interface IMessageSerializer
Properties
ContentType
Content type this serializer handles (e.g., "application/json").
string ContentType { get; }
MediaTypes
All media types this serializer can handle, including structured-suffix aliases
IReadOnlyCollection<string> MediaTypes { get; }
WrapsBytes
true for a format whose input is raw bytes rather than an object model (Base64, GZip, Zip):
bool WrapsBytes { get; }
Methods
Deserialize(byte[], Type)
Deserializes a byte array to a typed value.
object? Deserialize(byte[] data, Type type)