add Marshallers.Create factory method

pull/16367/head
Jan Tattermusch 6 years ago
parent fb704ee949
commit 6ba637f7ec
  1. 9
      src/csharp/Grpc.Core/Marshaller.cs

@ -162,6 +162,15 @@ namespace Grpc.Core
return new Marshaller<T>(serializer, deserializer);
}
/// <summary>
/// Creates a marshaller from specified contextual serializer and deserializer.
/// Note: This method is part of an experimental API that can change or be removed without any prior notice.
/// </summary>
public static Marshaller<T> Create<T>(Action<T, SerializationContext> serializer, Func<DeserializationContext, T> deserializer)
{
return new Marshaller<T>(serializer, deserializer);
}
/// <summary>
/// Returns a marshaller for <c>string</c> type. This is useful for testing.
/// </summary>

Loading…
Cancel
Save