Table of Contents

Interface ISerializer

Namespace
DMediatR
Assembly
DMediatR.dll

Interface for the base serializer and all specialized serializers. Use it for injecting an alternate base BinarySerializer implementation with services.AddKeyedSingleton<ISerializer, BinarySerializer>(typeof(object)); Its pluggable default implementation is a tiny wrapper around MessagePackSerializer.Typeless.

public interface ISerializer

Methods

Deserialize(Type, byte[])

object Deserialize(Type type, byte[] bytes)

Parameters

type Type
bytes byte[]

Returns

object

Deserialize<T>(byte[])

T Deserialize<T>(byte[] bytes)

Parameters

bytes byte[]

Returns

T

Type Parameters

T

Serialize(object)

byte[] Serialize(object obj)

Parameters

obj object

Returns

byte[]

Serialize(Type, object)

byte[] Serialize(Type type, object obj)

Parameters

type Type
obj object

Returns

byte[]