// Generated by the protocol buffer compiler. DO NOT EDIT! // source: helloworld.proto #region Designer generated code using System; using System.Threading; using System.Threading.Tasks; using Grpc.Core; namespace helloworld { public static class Greeter { static readonly string __ServiceName = "helloworld.Greeter"; static readonly Marshaller __Marshaller_HelloRequest = Marshallers.Create((arg) => arg.ToByteArray(), HelloRequest.ParseFrom); static readonly Marshaller __Marshaller_HelloReply = Marshallers.Create((arg) => arg.ToByteArray(), HelloReply.ParseFrom); static readonly Method __Method_SayHello = new Method( MethodType.Unary, "SayHello", __Marshaller_HelloRequest, __Marshaller_HelloReply); // client-side stub interface public interface IGreeterClient { HelloReply SayHello(HelloRequest request, CancellationToken token = default(CancellationToken)); Task SayHelloAsync(HelloRequest request, CancellationToken token = default(CancellationToken)); } // server-side interface public interface IGreeter { Task SayHello(ServerCallContext context, HelloRequest request); } // client stub public class GreeterClient : AbstractStub, IGreeterClient { public GreeterClient(Channel channel) : this(channel, StubConfiguration.Default) { } public GreeterClient(Channel channel, StubConfiguration config) : base(channel, config) { } public HelloReply SayHello(HelloRequest request, CancellationToken token = default(CancellationToken)) { var call = CreateCall(__ServiceName, __Method_SayHello); return Calls.BlockingUnaryCall(call, request, token); } public Task SayHelloAsync(HelloRequest request, CancellationToken token = default(CancellationToken)) { var call = CreateCall(__ServiceName, __Method_SayHello); return Calls.AsyncUnaryCall(call, request, token); } } // creates service definition that can be registered with a server public static ServerServiceDefinition BindService(IGreeter serviceImpl) { return ServerServiceDefinition.CreateBuilder(__ServiceName) .AddMethod(__Method_SayHello, serviceImpl.SayHello).Build(); } // creates a new client stub public static IGreeterClient NewStub(Channel channel) { return new GreeterClient(channel); } // creates a new client stub public static IGreeterClient NewStub(Channel channel, StubConfiguration config) { return new GreeterClient(channel, config); } } } #endregion