Class MessageSerialiser<TAuthenticationToken>
Serialises IEvent<TAuthenticationToken> and ICommand<TAuthenticationToken>.
Inheritance
Namespace: Cqrs.Azure.ServiceBus
Assembly: Cqrs.Azure.ServiceBus.dll
Syntax
public class MessageSerialiser<TAuthenticationToken> : object, IMessageSerialiser<TAuthenticationToken>
Type Parameters
Name | Description |
---|---|
TAuthenticationToken | The |
Properties
DefaultSettings
The default
Declaration
public static JsonSerializerSettings DefaultSettings { get; }
Property Value
Type | Description |
---|---|
JsonSerializerSettings |
Methods
DeserialiseCommand(String)
Deserialise the provided command
from its
Declaration
public virtual ICommand<TAuthenticationToken> DeserialiseCommand(string command)
Parameters
Type | Name | Description |
---|---|---|
System.String | command | A |
Returns
Type | Description |
---|---|
ICommand<TAuthenticationToken> |
Implements
DeserialiseEvent(String)
Deserialise the provided event
from its
Declaration
public virtual IEvent<TAuthenticationToken> DeserialiseEvent(string event)
Parameters
Type | Name | Description |
---|---|---|
System.String | event | A |
Returns
Type | Description |
---|---|
IEvent<TAuthenticationToken> |
Implements
GetSerialisationSettings()
Returns DefaultSettings
Declaration
protected virtual JsonSerializerSettings GetSerialisationSettings()
Returns
Type | Description |
---|---|
JsonSerializerSettings | DefaultSettings |
SerialiseCommand<TCommand>(TCommand)
Serialise the provided command
.
Declaration
public virtual string SerialiseCommand<TCommand>(TCommand command)where TCommand : ICommand<TAuthenticationToken>
Parameters
Type | Name | Description |
---|---|---|
TCommand | command | The ICommand<TAuthenticationToken> being serialised. |
Returns
Type | Description |
---|---|
System.String | A |
Type Parameters
Name | Description |
---|---|
TCommand | The |
Implements
SerialiseEvent<TEvent>(TEvent)
Serialise the provided event
.
Declaration
public virtual string SerialiseEvent<TEvent>(TEvent event)where TEvent : IEvent<TAuthenticationToken>
Parameters
Type | Name | Description |
---|---|---|
TEvent | event | The IEvent<TAuthenticationToken> being serialised. |
Returns
Type | Description |
---|---|
System.String | A |
Type Parameters
Name | Description |
---|---|
TEvent | The |