Show / Hide Table of Contents

    Class NewtonsoftJsonMessageDeserializerBuilder

    Builds the NewtonsoftJsonMessageDeserializer<TMessage> or NewtonsoftJsonMessageDeserializer<TMessage>.

    Inheritance
    object
    NewtonsoftJsonMessageDeserializerBuilder
    Inherited Members
    object.GetType()
    object.MemberwiseClone()
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    Namespace: Silverback.Messaging.Configuration
    Assembly: Silverback.Integration.Newtonsoft.dll
    Syntax
    public class NewtonsoftJsonMessageDeserializerBuilder

    Constructors

    NewtonsoftJsonMessageDeserializerBuilder()

    Builds the NewtonsoftJsonMessageDeserializer<TMessage> or NewtonsoftJsonMessageDeserializer<TMessage>.

    Declaration
    public NewtonsoftJsonMessageDeserializerBuilder()

    Methods

    Build()

    Builds the IMessageDeserializer instance.

    Declaration
    public IMessageDeserializer Build()
    Returns
    Type Description
    IMessageDeserializer

    The IMessageDeserializer.

    Configure(Action<JsonSerializerSettings>)

    Configures the Newtonsoft.Json.JsonSerializerSettings.

    Declaration
    public NewtonsoftJsonMessageDeserializerBuilder Configure(Action<JsonSerializerSettings> configureAction)
    Parameters
    Type Name Description
    Action<JsonSerializerSettings> configureAction

    An Action<T> that takes the Newtonsoft.Json.JsonSerializerSettings and configures it.

    Returns
    Type Description
    NewtonsoftJsonMessageDeserializerBuilder

    The NewtonsoftJsonMessageDeserializerBuilder so that additional calls can be chained.

    IgnoreMessageTypeHeader()

    Specifies that the message type header must be ignored. The message will always be deserialized into the predefined model.

    Declaration
    public NewtonsoftJsonMessageDeserializerBuilder IgnoreMessageTypeHeader()
    Returns
    Type Description
    NewtonsoftJsonMessageDeserializerBuilder

    The NewtonsoftJsonMessageDeserializerBuilder so that additional calls can be chained.

    UseModel(Type)

    Specifies a fixed message type. This will prevent the message type header to be written when serializing and the header will be ignored when deserializing.

    Declaration
    public NewtonsoftJsonMessageDeserializerBuilder UseModel(Type messageType)
    Parameters
    Type Name Description
    Type messageType

    The type of the message to serialize or deserialize.

    Returns
    Type Description
    NewtonsoftJsonMessageDeserializerBuilder

    The NewtonsoftJsonMessageDeserializerBuilder so that additional calls can be chained.

    UseModel<TMessage>()

    Specifies a fixed message type. This will prevent the message type header to be written when serializing and the header will be ignored when deserializing.

    Declaration
    public NewtonsoftJsonMessageDeserializerBuilder UseModel<TMessage>()
    Returns
    Type Description
    NewtonsoftJsonMessageDeserializerBuilder

    The NewtonsoftJsonMessageDeserializerBuilder so that additional calls can be chained.

    Type Parameters
    Name Description
    TMessage

    The type of the message to serialize or deserialize.

    WithEncoding(MessageEncoding)

    Specifies the encoding to be used.

    Declaration
    public NewtonsoftJsonMessageDeserializerBuilder WithEncoding(MessageEncoding encoding)
    Parameters
    Type Name Description
    MessageEncoding encoding

    The MessageEncoding.

    Returns
    Type Description
    NewtonsoftJsonMessageDeserializerBuilder

    The NewtonsoftJsonMessageDeserializerBuilder so that additional calls can be chained.

    WithMandatoryMessageTypeHeader()

    Specifies that an exception must be thrown if the consumed message doesn't specify the message type header.

    Declaration
    public NewtonsoftJsonMessageDeserializerBuilder WithMandatoryMessageTypeHeader()
    Returns
    Type Description
    NewtonsoftJsonMessageDeserializerBuilder

    The NewtonsoftJsonMessageDeserializerBuilder so that additional calls can be chained.

    WithOptionalMessageTypeHeader()

    Specifies that the message type header must be used when sent with the consumed message, otherwise the predefined model has to be used.

    Declaration
    public NewtonsoftJsonMessageDeserializerBuilder WithOptionalMessageTypeHeader()
    Returns
    Type Description
    NewtonsoftJsonMessageDeserializerBuilder

    The NewtonsoftJsonMessageDeserializerBuilder so that additional calls can be chained.

    GitHub E-Mail
    ↑ Back to top © 2026 Sergio Aquilini