Class NewtonsoftJsonMessageSerializerBuilder
Builds the NewtonsoftJsonMessageSerializer.
Inherited Members
Namespace: Silverback.Messaging.Configuration
Assembly: Silverback.Integration.Newtonsoft.dll
Syntax
public class NewtonsoftJsonMessageSerializerBuilder
Constructors
NewtonsoftJsonMessageSerializerBuilder()
Builds the NewtonsoftJsonMessageSerializer.
Declaration
public NewtonsoftJsonMessageSerializerBuilder()
Methods
Build()
Builds the IMessageSerializer instance.
Declaration
public IMessageSerializer Build()
Returns
| Type | Description |
|---|---|
| IMessageSerializer | The IMessageSerializer. |
Configure(Action<JsonSerializerSettings>)
Configures the Newtonsoft.Json.JsonSerializerSettings.
Declaration
public NewtonsoftJsonMessageSerializerBuilder 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 |
|---|---|
| NewtonsoftJsonMessageSerializerBuilder | The NewtonsoftJsonMessageSerializerBuilder so that additional calls can be chained. |
DisableTypeHeader()
Specifies that the message type header (see MessageType) must not be set.
Declaration
public NewtonsoftJsonMessageSerializerBuilder DisableTypeHeader()
Returns
| Type | Description |
|---|---|
| NewtonsoftJsonMessageSerializerBuilder | The NewtonsoftJsonMessageSerializerBuilder so that additional calls can be chained. |
SetTypeHeader()
Specifies that the message type header (see MessageType) must be set. This is necessary when sending multiple message type through the same endpoint, to allow Silverback to automatically figure out the correct type to deserialize into.
Declaration
public NewtonsoftJsonMessageSerializerBuilder SetTypeHeader()
Returns
| Type | Description |
|---|---|
| NewtonsoftJsonMessageSerializerBuilder | The NewtonsoftJsonMessageSerializerBuilder so that additional calls can be chained. |
WithEncoding(MessageEncoding)
Specifies the encoding to be used.
Declaration
public NewtonsoftJsonMessageSerializerBuilder WithEncoding(MessageEncoding encoding)
Parameters
| Type | Name | Description |
|---|---|---|
| MessageEncoding | encoding | The MessageEncoding. |
Returns
| Type | Description |
|---|---|
| NewtonsoftJsonMessageSerializerBuilder | The NewtonsoftJsonMessageSerializerBuilder so that additional calls can be chained. |