Exemplo n.º 1
0
        /// <summary>
        /// Convenience method to deserialize an object graph from a message.
        /// </summary>
        /// <param name="msg">Message containing serialized state.</param>
        /// <typeparam name="T">The type to use if not specified in the metadata.</typeparam>
        /// <returns>Deserialized object graph.</returns>
        public T Deserialize <T>(FudgeMsg msg)
        {
            // Delegate to FudgeDeserializer to do the work
            var deserializer = new MessageFudgeDeserializationContext(context, typeMap, TypeMappingStrategy, msg);

            return(deserializer.DeserializeGraph <T>());
        }
Exemplo n.º 2
0
        /// <summary>
        /// Convenience method to deserialize an object graph from a message.
        /// </summary>
        /// <param name="msg">Message containing serialized state.</param>
        /// <param name="hintType">The type to use if not specified in the metadata.</param>
        /// <returns>Deserialized object graph.</returns>
        public object Deserialize(FudgeMsg msg, Type hintType = null)
        {
            // Delegate to FudgeDeserializer to do the work
            var deserializer = new MessageFudgeDeserializationContext(context, typeMap, TypeMappingStrategy, msg);

            return(deserializer.DeserializeGraph(hintType));
        }