Beispiel #1
0
        public override Task <NameResult> ShowHello(RpcContractGrpc.HelloResult request, ServerCallContext context)
        {
            Console.WriteLine($"from grpc {request.Name} call SayHello! [{ServiceName}]");
            var result = new NameResult
            {
                Name = $"from grpc name:{request.Name};gender:{request.Gender};avatar:{request.Head} [{ServiceName}]"
            };

            return(Task.FromResult <NameResult>(result));
        }
Beispiel #2
0
        public override Task <RpcContractGrpc.HelloResult> SayHello(NameResult request, ServerCallContext context)
        {
            Console.WriteLine($"from grpc {request.Name} call SayHello! [{ServiceName}]");
            var result = new RpcContractGrpc.HelloResult
            {
                Name   = $"from grpc {request.Name} [{ServiceName}]",
                Gender = "male",
                Head   = "head.png"
            };

            return(Task.FromResult <RpcContractGrpc.HelloResult>(result));
        }