Exemple #1
0
        //Unary(URPC) gRPC--简单
        //传入一个请求对象,返回一个对象
        private static async Task CustomeGrpcMethod()
        {
            using (var channel = GrpcChannel.ForAddress("https://localhost:5001"))
            {
                var client = new Test.TestClient(channel);
                var reply  = await client.PlusAsync(new RequestPara { ILeft = 1, IRight = 2 });

                Console.WriteLine($"CustomergRPC:Message={reply.Message},Result={reply.Result}");
            }
        }