private static byte[] SerializeInternal <T>(IMarshallerFactory factory, object value) { using (var context = new DefaultSerializationContext()) { factory.CreateMarshaller <T>().ContextualSerializer((T)value, context); return(context.GetContent()); } }
private static object DeserializeInternal <T>(IMarshallerFactory factory, byte[] content) { var result = factory.CreateMarshaller <T>().ContextualDeserializer(new DefaultDeserializationContext(content)); return(result !); }
public static T DeserializeMethodInput <T>(IMarshallerFactory marshallerFactory, Metadata?requestHeaders) { var message = CompatibilityTools.DeserializeMethodInputHeader(marshallerFactory.CreateMarshaller <Message <T> >(), requestHeaders); return(message.Value1); }
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))); }