Interface IMessageSerializer

Assembly: redb.Route.dll

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)

Deserialize<T>(byte[])

Deserializes a byte array to a typed value.

T? Deserialize<T>(byte[] data)

Serialize<T>(T)

Serializes a value to a byte array.

byte[] Serialize<T>(T value)