示例#1
0
 public async Task <IActionResult> Post([FromBody] Update update)
 {
     try
     {
         await _updateService.EchoAsync(update);
     }
     catch (Exception e)
     {
         _logger.LogError(e.ToString());
     }
     return(Ok());
 }
示例#2
0
        public async Task <ActionResult <byte[]> > GetSimple([FromBody] RestEchoRequest restEchoRequest)
        {
            _logger.LogInformation($"Echo with size '{restEchoRequest.Size}'");

            var echoRequest = new EchoRequest
            {
                Size = restEchoRequest.Size
            };

            var response = await _echoService.EchoAsync(echoRequest);

            return(Ok(response));
        }
示例#3
0
        public override async Task <GrpcEchoResponse> Echo(GrpcEchoRequest request, ServerCallContext context)
        {
            _logger.LogInformation($"Echo with size '{request.Size}'");

            var echoRequest = new EchoRequest
            {
                Size = request.Size
            };

            var response = await _echoService.EchoAsync(echoRequest);

            return(new GrpcEchoResponse {
                Bytes = ByteString.CopyFrom(response)
            });
        }