public async Task <double> AddAsync(double value1, double value2) { var request = new Protos.AddRequest { Value1 = value1, Value2 = value2, }; var response = await _client.AddAsync(request); var returnValue = response.Value; return(returnValue); }
public override Task <Protos.AddResponse> Add(Protos.AddRequest request, ServerCallContext context) { try { var returnValue = _serviceContract.Add(request.Value1, request.Value2); var response = new Protos.AddResponse { Value = returnValue }; return(Task.FromResult(response)); } catch (Exception ex) { _logger.LogError(ex, "Error invoking Add"); throw new RpcException(new Status(StatusCode.Internal, ex.Message)); } }