/// <summary> /// Deserializes the message. /// </summary> /// <typeparam name="TMessageType">The type of the message type.</typeparam> /// <param name="body">The body.</param> /// <returns></returns> public Message <TMessageType> DeserializeMessage <TMessageType>(byte[] body) { return(SerializationUtility.Deserialize <Message <TMessageType> >(body)); }
/// <summary> /// Creates a serialized message with a specified message type and body. /// </summary> /// <typeparam name="TMessageType">The type of the message type.</typeparam> /// <param name="messageType">Type of the message.</param> /// <param name="body">The body.</param> /// <returns></returns> public byte[] CreateSerializedMessage <TMessageType>(TMessageType messageType, byte[] body) { Message <TMessageType> message = new Message <TMessageType>(this._SenderId, DateTime.UtcNow, messageType, body); return(SerializationUtility.Serialize <Message <TMessageType> >(message)); }