private static void SerializeStream <T>(T value, SerializationContext context) { using (var buffer = context.AsStream()) { RuntimeTypeModel.Default.Serialize(buffer, value); } context.Complete(); }
private static void Serialize(T value, SerializationContext context) { using (var buffer = context.AsStream()) { Serializer.WriteObject(buffer, value); } context.Complete(); }
private static void SerializeStream <T>(T value, SerializationContext context) { using (var stream = context.AsStream()) { MessagePackSerializer.Serialize(stream, value); } context.Complete(); }
private static void Serialize(T value, SerializationContext context) { using (var buffer = context.AsStream()) { var serializer = new DataContractSerializer(typeof(T)); serializer.WriteObject(buffer, value); } context.Complete(); }