Show / Hide Table of Contents

    Class ProducerEndpointBuilderSerializeAsJsonUsingNewtonsoftExtensions

    Adds the SerializeAsJsonUsingNewtonsoft method to the ProducerEndpoint.

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

    Methods

    | Improve this doc View source

    SerializeAsJsonUsingNewtonsoft<TBuilder>(IProducerEndpointBuilder<TBuilder>, Action<INewtonsoftJsonMessageSerializerBuilder>?)

    Sets the serializer to an instance of NewtonsoftJsonMessageSerializer (or NewtonsoftJsonMessageSerializer<TMessage>) to serialize the produced messages as JSON.

    By default this serializer forwards the message type in an header to let the consumer know which type has to be deserialized. This approach allows to mix messages of different types in the same endpoint and it's ideal when both the producer and the consumer are using Silverback but might not be optimal for interoperability. This behavior can be changed using the builder action and specifying a fixed message type.

    Declaration
    public static TBuilder SerializeAsJsonUsingNewtonsoft<TBuilder>(this IProducerEndpointBuilder<TBuilder> endpointBuilder, Action<INewtonsoftJsonMessageSerializerBuilder>? serializerBuilderAction = null) where TBuilder : IProducerEndpointBuilder<TBuilder>
    Parameters
    Type Name Description
    IProducerEndpointBuilder<TBuilder> endpointBuilder

    The endpoint builder.

    Action<INewtonsoftJsonMessageSerializerBuilder> serializerBuilderAction

    An optional Action<T> that takes the INewtonsoftJsonMessageSerializerBuilder and configures it.

    Returns
    Type Description
    TBuilder

    The endpoint builder so that additional calls can be chained.

    Type Parameters
    Name Description
    TBuilder

    The actual builder type.

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