MessageSerializationExtensionsSerializeT Method
The IMessage.Serailize extension method.
Serializes the data into the message with ISerializer.
Note this may modify the IMessage binary attachment and user properties.
Note the user properties will be reset for field iteration. So
Rewind is called.
Namespace: SolaceSystems.Solclient.Messaging.SerializationAssembly: SolaceSystems.Solclient.Messaging (in SolaceSystems.Solclient.Messaging.dll) Version: 10.29.0
public static void Serialize<T>(
this IMessage msg,
ISerializer<T> serializer,
T data,
IDestination destination = null
)
- msg IMessage
- IMessage to serialize data into
- serializer ISerializerT
-
ISerializer to convert data.
Passing unsupported header value data types will result in SerializationException being thrown. Check logs for details.
The list of header value data types supported for serialization:
- string
- bool
- null
- byte[]
- byte
- sbyte
- ushort
- short
- uint
- int
- ulong
- long
- char
- float
- double
- data T
- The data object to serialize
- destination IDestination (Optional)
- optional destination provided to serializer, uses IMessage.Destination if null.
- T
- type of data to serialize
In Visual Basic and C#, you can call this method as an instance method on any object of type
IMessage. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
| SerializationException | When serializer fails to serialize data. |