Show / Hide Table of Contents

    Class NewtonsoftJsonMessageSerializerBase

    The base class for NewtonsoftJsonMessageSerializer and NewtonsoftJsonMessageSerializer<TMessage>.

    Inheritance
    object
    NewtonsoftJsonMessageSerializerBase
    NewtonsoftJsonMessageSerializer
    NewtonsoftJsonMessageSerializer<TMessage>
    Implements
    IMessageSerializer
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Silverback.Messaging.Serialization
    Assembly: Silverback.Integration.Newtonsoft.dll
    Syntax
    public abstract class NewtonsoftJsonMessageSerializerBase : IMessageSerializer

    Properties

    | Improve this doc View source

    Encoding

    Gets or sets the message encoding. The default is UTF8.

    Declaration
    public MessageEncoding Encoding { get; set; }
    Property Value
    Type Description
    MessageEncoding
    | Improve this doc View source

    RequireHeaders

    Gets a value indicating whether headers are mandatory for this serializer implementation or configuration to work properly.

    Declaration
    public abstract bool RequireHeaders { get; }
    Property Value
    Type Description
    bool
    | Improve this doc View source

    Settings

    Gets or sets the settings to be applied to the Json.NET serializer.

    Declaration
    public JsonSerializerSettings Settings { get; set; }
    Property Value
    Type Description
    JsonSerializerSettings
    | Improve this doc View source

    SystemEncoding

    Gets the Encoding corresponding to the MessageEncoding.

    Declaration
    protected Encoding SystemEncoding { get; }
    Property Value
    Type Description
    Encoding

    A Encoding that matches the current MessageEncoding.

    Methods

    | Improve this doc View source

    DeserializeAsync(Stream?, MessageHeaderCollection, MessageSerializationContext)

    Deserializes the byte array back into a message object.

    Declaration
    public abstract ValueTask<(object? Message, Type MessageType)> DeserializeAsync(Stream? messageStream, MessageHeaderCollection messageHeaders, MessageSerializationContext context)
    Parameters
    Type Name Description
    Stream messageStream

    The Stream containing the message to be deserialized.

    MessageHeaderCollection messageHeaders

    The message headers collection.

    MessageSerializationContext context

    The context information.

    Returns
    Type Description
    ValueTask<(object Message, Type MessageType)>

    A Task<TResult> representing the asynchronous operation. The task result contains the deserialized message (or null when the input is null or empty) and the type of the message.

    | Improve this doc View source

    SerializeAsync(object?, MessageHeaderCollection, MessageSerializationContext)

    Serializes the specified message object into a byte array.

    Declaration
    public abstract ValueTask<Stream?> SerializeAsync(object? message, MessageHeaderCollection messageHeaders, MessageSerializationContext context)
    Parameters
    Type Name Description
    object message

    The message object to be serialized.

    MessageHeaderCollection messageHeaders

    The message headers collection.

    MessageSerializationContext context

    The context information.

    Returns
    Type Description
    ValueTask<Stream>

    A Task<TResult> representing the asynchronous operation. The task result contains the Stream with the serialized message.

    Implements

    IMessageSerializer
    • Improve this doc
    • View source
    GitHub E-Mail
    ↑ Back to top © 2020 Sergio Aquilini