From 6ba637f7ecdd45bf43c1a7959115190ca5a2f5c8 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 27 Aug 2018 20:42:06 +0200 Subject: [PATCH] add Marshallers.Create factory method --- src/csharp/Grpc.Core/Marshaller.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/csharp/Grpc.Core/Marshaller.cs b/src/csharp/Grpc.Core/Marshaller.cs index ad01b9383cd..7f010dc4192 100644 --- a/src/csharp/Grpc.Core/Marshaller.cs +++ b/src/csharp/Grpc.Core/Marshaller.cs @@ -162,6 +162,15 @@ namespace Grpc.Core return new Marshaller(serializer, deserializer); } + /// + /// 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. + /// + public static Marshaller Create(Action serializer, Func deserializer) + { + return new Marshaller(serializer, deserializer); + } + /// /// Returns a marshaller for string type. This is useful for testing. ///