コード例 #1
0
            public UnaryResult <MyResponse> Unary1(int x, int y, string z = "unknown")
            {
                var tuple = new DynamicArgumentTuple <int, int>(x, y);

                var method  = new Method <byte[], byte[]>(MethodType.Unary, "IArgumentPattern", "Unary1", MagicOnionMarshallers.ThroughMarshaller, MagicOnionMarshallers.ThroughMarshaller);
                var request = LZ4MessagePackSerializer.Serialize(tuple);

                var callResult = invoker.AsyncUnaryCall(method, null, default(CallOptions), request);

                return(new UnaryResult <MyResponse>(callResult, MessagePackSerializer.DefaultResolver));
            }
コード例 #2
0
            public UnaryResult <MyResponse> Unary1(int x, int y, string z = "unknown")
            {
                var tuple             = new DynamicArgumentTuple <int, int>(x, y);
                var formatter         = new DynamicArgumentTupleFormatter <DefaultResolver, int, int>(0, 0);
                var requestMarshaller = MagicOnionMarshallers.CreateZeroFormatterMarshaller(formatter);

                var method = new Method <byte[], byte[]>(MethodType.Unary, "IArgumentPattern", "Unary1", MagicOnionMarshallers.ByteArrayMarshaller, MagicOnionMarshallers.ByteArrayMarshaller);

                var request    = requestMarshaller.Serializer(tuple);
                var callResult = invoker.AsyncUnaryCall(method, null, default(CallOptions), request);

                var responseMarshaller = MagicOnionMarshallers.CreateZeroFormatterMarshaller(ZeroFormatter.Formatters.Formatter <DefaultResolver, MyResponse> .Default);

                return(new UnaryResult <MyResponse>(callResult, responseMarshaller));
            }