diff options
author | Jan Tattermusch <jtattermusch@google.com> | 2018-08-27 20:42:06 +0200 |
---|---|---|
committer | Jan Tattermusch <jtattermusch@google.com> | 2018-08-27 20:42:06 +0200 |
commit | 6ba637f7ecdd45bf43c1a7959115190ca5a2f5c8 (patch) | |
tree | 293a714743adf0164da994ee99763ab62f723632 /src/csharp | |
parent | fb704ee949047ebc1d78f00b4b7d6938f8e89a6a (diff) |
add Marshallers.Create factory method
Diffstat (limited to 'src/csharp')
-rw-r--r-- | src/csharp/Grpc.Core/Marshaller.cs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/csharp/Grpc.Core/Marshaller.cs b/src/csharp/Grpc.Core/Marshaller.cs index ad01b9383c..7f010dc419 100644 --- a/src/csharp/Grpc.Core/Marshaller.cs +++ b/src/csharp/Grpc.Core/Marshaller.cs @@ -163,6 +163,15 @@ namespace Grpc.Core } /// <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> public static Marshaller<string> StringMarshaller |