public override Task <PingResponse> UnaryPing(PingRequest request, ServerCallContext context) { if (request.Status == Status.Ok) { return(Task.FromResult(new PingResponse() { Message = "OK" })); } global::Grpc.Core.Status status = new global::Grpc.Core.Status(StatusCode.Internal, "details"); throw new RpcException(status); }
public override async Task <PingResponse> UnaryPing(PingRequest request, ServerCallContext context) { if (request.Status == Status.Ok) { PingResponse response = null; await Task.Run(() => response = new PingResponse() { Message = "OK" }); return(response); } global::Grpc.Core.Status status = new global::Grpc.Core.Status(StatusCode.Internal, "details"); throw new RpcException(status); }
private void ThrowException() { global::Grpc.Core.Status status = new global::Grpc.Core.Status(StatusCode.Internal, "details"); throw new RpcException(status); }