Class ServerServiceDefinition.Builder
Builder class for ServerServiceDefinition.
Inheritance
Inherited Members
Namespace: Grpc.Core
Assembly: Grpc.Core.Api.dll
Syntax
public class Builder
Constructors
Builder()
Creates a new instance of builder.
Declaration
public Builder()
Methods
AddMethod<TRequest, TResponse>(Method<TRequest, TResponse>, ClientStreamingServerMethod<TRequest, TResponse>)
Adds a definition for a client streaming method.
Declaration
public ServerServiceDefinition.Builder AddMethod<TRequest, TResponse>(Method<TRequest, TResponse> method, ClientStreamingServerMethod<TRequest, TResponse> handler)
where TRequest : class where TResponse : class
Parameters
Type | Name | Description |
---|---|---|
Method<TRequest, TResponse> | method | The method. |
ClientStreamingServerMethod<TRequest, TResponse> | handler | The method handler. |
Returns
Type | Description |
---|---|
ServerServiceDefinition.Builder | This builder instance. |
Type Parameters
Name | Description |
---|---|
TRequest | The request message class. |
TResponse | The response message class. |
AddMethod<TRequest, TResponse>(Method<TRequest, TResponse>, DuplexStreamingServerMethod<TRequest, TResponse>)
Adds a definition for a bidirectional streaming method.
Declaration
public ServerServiceDefinition.Builder AddMethod<TRequest, TResponse>(Method<TRequest, TResponse> method, DuplexStreamingServerMethod<TRequest, TResponse> handler)
where TRequest : class where TResponse : class
Parameters
Type | Name | Description |
---|---|---|
Method<TRequest, TResponse> | method | The method. |
DuplexStreamingServerMethod<TRequest, TResponse> | handler | The method handler. |
Returns
Type | Description |
---|---|
ServerServiceDefinition.Builder | This builder instance. |
Type Parameters
Name | Description |
---|---|
TRequest | The request message class. |
TResponse | The response message class. |
AddMethod<TRequest, TResponse>(Method<TRequest, TResponse>, ServerStreamingServerMethod<TRequest, TResponse>)
Adds a definition for a server streaming method.
Declaration
public ServerServiceDefinition.Builder AddMethod<TRequest, TResponse>(Method<TRequest, TResponse> method, ServerStreamingServerMethod<TRequest, TResponse> handler)
where TRequest : class where TResponse : class
Parameters
Type | Name | Description |
---|---|---|
Method<TRequest, TResponse> | method | The method. |
ServerStreamingServerMethod<TRequest, TResponse> | handler | The method handler. |
Returns
Type | Description |
---|---|
ServerServiceDefinition.Builder | This builder instance. |
Type Parameters
Name | Description |
---|---|
TRequest | The request message class. |
TResponse | The response message class. |
AddMethod<TRequest, TResponse>(Method<TRequest, TResponse>, UnaryServerMethod<TRequest, TResponse>)
Adds a definition for a single request - single response method.
Declaration
public ServerServiceDefinition.Builder AddMethod<TRequest, TResponse>(Method<TRequest, TResponse> method, UnaryServerMethod<TRequest, TResponse> handler)
where TRequest : class where TResponse : class
Parameters
Type | Name | Description |
---|---|---|
Method<TRequest, TResponse> | method | The method. |
UnaryServerMethod<TRequest, TResponse> | handler | The method handler. |
Returns
Type | Description |
---|---|
ServerServiceDefinition.Builder | This builder instance. |
Type Parameters
Name | Description |
---|---|
TRequest | The request message class. |
TResponse | The response message class. |
Build()
Creates an immutable ServerServiceDefinition
from this builder.
Declaration
public ServerServiceDefinition Build()
Returns
Type | Description |
---|---|
ServerServiceDefinition | The |