logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Interface ISerializer<T>

    Interface for serializing and deserializing objects to and from byte arrays.

    Namespace: Serenity.Persistence.Domain.Interfaces
    Assembly: Serenity.Global.Domain.dll
    Syntax
    public interface ISerializer<T>
    Type Parameters
    Name Description
    T

    The type of object to serialize/deserialize.

    Methods

    Deserialize(ReadOnlySpan<byte>)

    Deserializes the specified byte array to an object of type T.

    Declaration
    T Deserialize(ReadOnlySpan<byte> bytes)
    Parameters
    Type Name Description
    ReadOnlySpan<byte> bytes

    The byte array to deserialize.

    Returns
    Type Description
    T

    The deserialized object of type T.

    Serialize(T)

    Serializes the specified object to a byte array.

    Declaration
    byte[] Serialize(T value)
    Parameters
    Type Name Description
    T value

    The object to serialize.

    Returns
    Type Description
    byte[]

    A byte array representing the serialized object.

    In this article
    © 2026 Serenity. All Rights Reserved