diff options
Diffstat (limited to 'examples/csharp/Greeter/HelloworldGrpc.cs')
-rw-r--r-- | examples/csharp/Greeter/HelloworldGrpc.cs | 78 |
1 files changed, 0 insertions, 78 deletions
diff --git a/examples/csharp/Greeter/HelloworldGrpc.cs b/examples/csharp/Greeter/HelloworldGrpc.cs deleted file mode 100644 index 1ca9d2899b..0000000000 --- a/examples/csharp/Greeter/HelloworldGrpc.cs +++ /dev/null @@ -1,78 +0,0 @@ -// 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<global::helloworld.HelloRequest> __Marshaller_HelloRequest = Marshallers.Create((arg) => arg.ToByteArray(), global::helloworld.HelloRequest.ParseFrom); - static readonly Marshaller<global::helloworld.HelloReply> __Marshaller_HelloReply = Marshallers.Create((arg) => arg.ToByteArray(), global::helloworld.HelloReply.ParseFrom); - - static readonly Method<global::helloworld.HelloRequest, global::helloworld.HelloReply> __Method_SayHello = new Method<global::helloworld.HelloRequest, global::helloworld.HelloReply>( - MethodType.Unary, - "SayHello", - __Marshaller_HelloRequest, - __Marshaller_HelloReply); - - // client-side stub interface - public interface IGreeterClient - { - global::helloworld.HelloReply SayHello(global::helloworld.HelloRequest request, CancellationToken token = default(CancellationToken)); - Task<global::helloworld.HelloReply> SayHelloAsync(global::helloworld.HelloRequest request, CancellationToken token = default(CancellationToken)); - } - - // server-side interface - public interface IGreeter - { - Task<global::helloworld.HelloReply> SayHello(ServerCallContext context, global::helloworld.HelloRequest request); - } - - // client stub - public class GreeterClient : AbstractStub<GreeterClient, StubConfiguration>, IGreeterClient - { - public GreeterClient(Channel channel) : this(channel, StubConfiguration.Default) - { - } - public GreeterClient(Channel channel, StubConfiguration config) : base(channel, config) - { - } - public global::helloworld.HelloReply SayHello(global::helloworld.HelloRequest request, CancellationToken token = default(CancellationToken)) - { - var call = CreateCall(__ServiceName, __Method_SayHello); - return Calls.BlockingUnaryCall(call, request, token); - } - public Task<global::helloworld.HelloReply> SayHelloAsync(global::helloworld.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 |