diff options
Diffstat (limited to 'src/csharp/Grpc.Core/ServerServiceDefinition.cs')
-rw-r--r-- | src/csharp/Grpc.Core/ServerServiceDefinition.cs | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/src/csharp/Grpc.Core/ServerServiceDefinition.cs b/src/csharp/Grpc.Core/ServerServiceDefinition.cs index f08c7d88f3..01b1dc8f7b 100644 --- a/src/csharp/Grpc.Core/ServerServiceDefinition.cs +++ b/src/csharp/Grpc.Core/ServerServiceDefinition.cs @@ -75,17 +75,33 @@ namespace Grpc.Core public Builder AddMethod<TRequest, TResponse>( Method<TRequest, TResponse> method, - UnaryRequestServerMethod<TRequest, TResponse> handler) + UnaryServerMethod<TRequest, TResponse> handler) { - callHandlers.Add(GetFullMethodName(serviceName, method.Name), ServerCalls.UnaryRequestCall(method, handler)); + callHandlers.Add(GetFullMethodName(serviceName, method.Name), ServerCalls.UnaryCall(method, handler)); return this; } public Builder AddMethod<TRequest, TResponse>( Method<TRequest, TResponse> method, - StreamingRequestServerMethod<TRequest, TResponse> handler) + ClientStreamingServerMethod<TRequest, TResponse> handler) { - callHandlers.Add(GetFullMethodName(serviceName, method.Name), ServerCalls.StreamingRequestCall(method, handler)); + callHandlers.Add(GetFullMethodName(serviceName, method.Name), ServerCalls.ClientStreamingCall(method, handler)); + return this; + } + + public Builder AddMethod<TRequest, TResponse>( + Method<TRequest, TResponse> method, + ServerStreamingServerMethod<TRequest, TResponse> handler) + { + callHandlers.Add(GetFullMethodName(serviceName, method.Name), ServerCalls.ServerStreamingCall(method, handler)); + return this; + } + + public Builder AddMethod<TRequest, TResponse>( + Method<TRequest, TResponse> method, + DuplexStreamingServerMethod<TRequest, TResponse> handler) + { + callHandlers.Add(GetFullMethodName(serviceName, method.Name), ServerCalls.DuplexStreamingCall(method, handler)); return this; } |