public override Task <Response> SayGoodbye(GoodByeRequest request, ServerCallContext context)
 {
     return(Task.FromResult(new Response
     {
         IsSuccess = true,
         ResponseMsg = $"Bye,{request.Name}"
     }
                            ));
 }
예제 #2
0
        public override Task <GoodByeReply> GoodBye(GoodByeRequest request, Grpc.Core.ServerCallContext context)
        {
            var reply = new GoodByeReply()
            {
                Name = "yim"
            };

            _logger.LogInformation(request.Name);
            _logger.LogInformation(request.Message);

            var name = request.Name;

            if (string.IsNullOrWhiteSpace(name))
            {
                reply.Result  = false;
                reply.Message = "I don't who you are";
            }
            else
            {
                reply.Result  = true;
                reply.Message = $"Good bye {request.Name}";
            }
            return(Task.FromResult(reply));
        }