private static void GrpcHello(RpcContractGrpc.IHelloService helloServiceGrpc, string helloword = "world") { var callNameVoid = helloServiceGrpc.CallNameVoid(new RpcContractGrpc.Void()); Console.WriteLine(callNameVoid); helloServiceGrpc.CallName(new RpcContractGrpc.NameResult { Name = helloword }); Console.WriteLine("CallName called"); helloServiceGrpc.CallVoid(new RpcContractGrpc.Void()); Console.WriteLine("CallVoid called"); var hello = helloServiceGrpc.Hello(new RpcContractGrpc.NameResult { Name = helloword }); Console.WriteLine(hello.Name); var helloResult = helloServiceGrpc.SayHello(new RpcContractGrpc.NameResult { Name = $"{helloword} perfect world" }); Console.WriteLine($"{helloResult.Name},{helloResult.Gender},{helloResult.Head}"); helloResult.Name = helloword + "show perfect world"; var showResult = helloServiceGrpc.ShowHello(helloResult); Console.WriteLine(showResult.Name); }
private static async Task GrpcHello(RpcContractGrpc.IHelloService helloServiceGrpc, string helloword = "world") { Console.WriteLine("GrpcHello---------------------------------------------------------------------------"); var callNameVoid = await helloServiceGrpc.CallNameVoidAsync(new RpcContractGrpc.Void()); Console.WriteLine(callNameVoid); await helloServiceGrpc.CallNameAsync(new RpcContractGrpc.NameResult { Name = helloword }); Console.WriteLine("CallName called"); await helloServiceGrpc.CallVoidAsync(new RpcContractGrpc.Void()); Console.WriteLine("CallVoid called"); var hello = await helloServiceGrpc.HelloAsync(new RpcContractGrpc.NameResult { Name = helloword }); Console.WriteLine(hello.Name); var helloResult = await helloServiceGrpc.SayHelloAsync(new RpcContractGrpc.NameResult { Name = $"{helloword} perfect world" }); Console.WriteLine($"{helloResult.Name},{helloResult.Gender},{helloResult.Head}"); helloResult.Name = helloword + " show perfect world"; var showResult = await helloServiceGrpc.ShowHelloAsync(helloResult); Console.WriteLine(showResult.Name); GrpcHelloCall(helloServiceGrpc, helloword); }