public async Task <IActionResult> Post([FromBody] Update update) { try { await _updateService.EchoAsync(update); } catch (Exception e) { _logger.LogError(e.ToString()); } return(Ok()); }
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)); }
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) }); }