Exemplo n.º 1
0
 private static byte[] SerializeInternal <T>(IMarshallerFactory factory, object value)
 {
     using (var context = new DefaultSerializationContext())
     {
         factory.CreateMarshaller <T>().ContextualSerializer((T)value, context);
         return(context.GetContent());
     }
 }
Exemplo n.º 2
0
        private static object DeserializeInternal <T>(IMarshallerFactory factory, byte[] content)
        {
            var result = factory.CreateMarshaller <T>().ContextualDeserializer(new DefaultDeserializationContext(content));

            return(result !);
        }
Exemplo n.º 3
0
        public static T DeserializeMethodInput <T>(IMarshallerFactory marshallerFactory, Metadata?requestHeaders)
        {
            var message = CompatibilityTools.DeserializeMethodInputHeader(marshallerFactory.CreateMarshaller <Message <T> >(), requestHeaders);

            return(message.Value1);
        }
Exemplo n.º 4
0
 public static Metadata SerializeMethodInput <T1, T2>(IMarshallerFactory marshallerFactory, T1 value1, T2 value2)
 {
     return(CompatibilityTools.SerializeMethodInputHeader(marshallerFactory.CreateMarshaller <Message <T1, T2> >(), new Message <T1, T2>(value1, value2)));
 }