# Class ServiceBinderBase (2.66.0)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [2.66.0 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServiceBinderBase)
- [2.63.0](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/2.63.0/Grpc.Core.ServiceBinderBase)
- [2.48.0](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/2.48.0/Grpc.Core.ServiceBinderBase)

    public class ServiceBinderBase

Allows binding server-side method implementations in alternative serving stacks.
Instances of this class are usually populated by the `BindService` method
that is part of the autogenerated code for a protocol buffers service definition.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> ServiceBinderBase

## Inherited Members

[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)) [object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)) [object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone) [object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Grpc.Core](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core)

## Assembly

Grpc.Core.Api.dll

## Methods

### AddMethod\<TRequest, TResponse\>(Method\<TRequest, TResponse\>, ClientStreamingServerMethod\<TRequest, TResponse\>?)

    public virtual void AddMethod<TRequest, TResponse>(Method<TRequest, TResponse> method, ClientStreamingServerMethod<TRequest, TResponse>? handler) where TRequest : class where TResponse : class

Adds a definition for a client streaming method.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `method` | `https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.Method-2` The method. |
| `handler` | `https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ClientStreamingServerMethod-2` The method handler. |

| **Type Parameters** ||
|---|---|
| **Name** | **Description** |
| `TRequest` | The request message class. |
| `TResponse` | The response message class. |

### AddMethod\<TRequest, TResponse\>(Method\<TRequest, TResponse\>, DuplexStreamingServerMethod\<TRequest, TResponse\>?)

    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.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `method` | `https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.Method-2` The method. |
| `handler` | `https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.DuplexStreamingServerMethod-2` The method handler. |

| **Type Parameters** ||
|---|---|
| **Name** | **Description** |
| `TRequest` | The request message class. |
| `TResponse` | The response message class. |

### AddMethod\<TRequest, TResponse\>(Method\<TRequest, TResponse\>, ServerStreamingServerMethod\<TRequest, TResponse\>?)

    public virtual void AddMethod<TRequest, TResponse>(Method<TRequest, TResponse> method, ServerStreamingServerMethod<TRequest, TResponse>? handler) where TRequest : class where TResponse : class

Adds a definition for a server streaming method.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `method` | `https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.Method-2` The method. |
| `handler` | `https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ServerStreamingServerMethod-2` The method handler. |

| **Type Parameters** ||
|---|---|
| **Name** | **Description** |
| `TRequest` | The request message class. |
| `TResponse` | The response message class. |

### AddMethod\<TRequest, TResponse\>(Method\<TRequest, TResponse\>, UnaryServerMethod\<TRequest, TResponse\>?)

    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.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `method` | `https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.Method-2` The method. |
| `handler` | `https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.UnaryServerMethod-2` The method handler. |

| **Type Parameters** ||
|---|---|
| **Name** | **Description** |
| `TRequest` | The request message class. |
| `TResponse` | The response message class. |