Allows binding server-side method implementations in alternative serving stacks.
Instances of this class are usually populated by theBindServicemethod
that is part of the autogenerated code for a protocol buffers service definition.
public virtual void AddMethod<TRequest, TResponse>(Method<TRequest, TResponse> method, ClientStreamingServerMethod<TRequest, TResponse>? handler) where TRequest : class where TResponse : class
public virtual void AddMethod<TRequest, TResponse>(Method<TRequest, TResponse> method, DuplexStreamingServerMethod<TRequest, TResponse>? handler) where TRequest : class where TResponse : class
Adds a definition for a bidirectional streaming method.
public virtual void AddMethod<TRequest, TResponse>(Method<TRequest, TResponse> method, ServerStreamingServerMethod<TRequest, TResponse>? handler) where TRequest : class where TResponse : class
public virtual void AddMethod<TRequest, TResponse>(Method<TRequest, TResponse> method, UnaryServerMethod<TRequest, TResponse>? handler) where TRequest : class where TResponse : class
Adds a definition for a single request - single response method.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\u003cp\u003e\u003ccode\u003eServiceBinderBase\u003c/code\u003e facilitates the binding of server-side method implementations in alternative serving stacks within the Grpc.Core namespace.\u003c/p\u003e\n"],["\u003cp\u003eThis class is typically populated via the \u003ccode\u003eBindService\u003c/code\u003e method, which is automatically generated for protocol buffers service definitions.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eServiceBinderBase\u003c/code\u003e class inherits from \u003ccode\u003eobject\u003c/code\u003e, providing standard object methods, and is found in the Grpc.Core.Api.dll assembly.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eAddMethod\u003c/code\u003e methods are used to define various types of server methods, including client streaming, bidirectional streaming, server streaming, and unary (single request-single response).\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eAddMethod\u003c/code\u003e definitions require a \u003ccode\u003emethod\u003c/code\u003e and a \u003ccode\u003ehandler\u003c/code\u003e as parameters, and also require \u003ccode\u003eTRequest\u003c/code\u003e and \u003ccode\u003eTResponse\u003c/code\u003e type parameters for the message classes.\u003c/p\u003e\n"]]],[],null,["# Class ServiceBinderBase (2.66.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.66.0 (latest)](/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServiceBinderBase)\n- [2.63.0](/dotnet/docs/reference/Grpc.Core/2.63.0/Grpc.Core.ServiceBinderBase)\n- [2.48.0](/dotnet/docs/reference/Grpc.Core/2.48.0/Grpc.Core.ServiceBinderBase) \n\n public class ServiceBinderBase\n\nAllows binding server-side method implementations in alternative serving stacks.\nInstances of this class are usually populated by the `BindService` method\nthat is part of the autogenerated code for a protocol buffers service definition. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e ServiceBinderBase \n\nInherited Members\n-----------------\n\n[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)) \n[object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)) \n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone) \n[object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Grpc.Core](/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core)\n\nAssembly\n--------\n\nGrpc.Core.Api.dll\n\nMethods\n-------\n\n### AddMethod\\\u003cTRequest, TResponse\\\u003e(Method\\\u003cTRequest, TResponse\\\u003e, ClientStreamingServerMethod\\\u003cTRequest, TResponse\\\u003e?)\n\n public virtual void AddMethod\u003cTRequest, TResponse\u003e(Method\u003cTRequest, TResponse\u003e method, ClientStreamingServerMethod\u003cTRequest, TResponse\u003e? handler) where TRequest : class where TResponse : class\n\nAdds a definition for a client streaming method.\n\n### AddMethod\\\u003cTRequest, TResponse\\\u003e(Method\\\u003cTRequest, TResponse\\\u003e, DuplexStreamingServerMethod\\\u003cTRequest, TResponse\\\u003e?)\n\n public virtual void AddMethod\u003cTRequest, TResponse\u003e(Method\u003cTRequest, TResponse\u003e method, DuplexStreamingServerMethod\u003cTRequest, TResponse\u003e? handler) where TRequest : class where TResponse : class\n\nAdds a definition for a bidirectional streaming method.\n\n### AddMethod\\\u003cTRequest, TResponse\\\u003e(Method\\\u003cTRequest, TResponse\\\u003e, ServerStreamingServerMethod\\\u003cTRequest, TResponse\\\u003e?)\n\n public virtual void AddMethod\u003cTRequest, TResponse\u003e(Method\u003cTRequest, TResponse\u003e method, ServerStreamingServerMethod\u003cTRequest, TResponse\u003e? handler) where TRequest : class where TResponse : class\n\nAdds a definition for a server streaming method.\n\n### AddMethod\\\u003cTRequest, TResponse\\\u003e(Method\\\u003cTRequest, TResponse\\\u003e, UnaryServerMethod\\\u003cTRequest, TResponse\\\u003e?)\n\n public virtual void AddMethod\u003cTRequest, TResponse\u003e(Method\u003cTRequest, TResponse\u003e method, UnaryServerMethod\u003cTRequest, TResponse\u003e? handler) where TRequest : class where TResponse : class\n\nAdds a definition for a single request - single response method."]]