Class ServerServiceDefinition.Builder

public class Builder : object

Builder class for ServerServiceDefinition.

Inheritance

Object > ServerServiceDefinition.Builder

Namespace

Grpc.Core

Assembly

Grpc.Core.Api.dll

Constructors

Builder()

public Builder()

Creates a new instance of builder.

Methods

AddMethod<TRequest, TResponse>(Method<TRequest, TResponse>, ClientStreamingServerMethod<TRequest, TResponse>)

public ServerServiceDefinition.Builder 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
TypeNameDescription
Method<TRequest, TResponse>method

The method.

ClientStreamingServerMethod<TRequest, TResponse>handler

The method handler.

Returns
TypeDescription
ServerServiceDefinition.Builder

This builder instance.

Type Parameters
NameDescription
TRequest

The request message class.

TResponse

The response message class.

AddMethod<TRequest, TResponse>(Method<TRequest, TResponse>, DuplexStreamingServerMethod<TRequest, TResponse>)

public ServerServiceDefinition.Builder 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
TypeNameDescription
Method<TRequest, TResponse>method

The method.

DuplexStreamingServerMethod<TRequest, TResponse>handler

The method handler.

Returns
TypeDescription
ServerServiceDefinition.Builder

This builder instance.

Type Parameters
NameDescription
TRequest

The request message class.

TResponse

The response message class.

AddMethod<TRequest, TResponse>(Method<TRequest, TResponse>, ServerStreamingServerMethod<TRequest, TResponse>)

public ServerServiceDefinition.Builder 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
TypeNameDescription
Method<TRequest, TResponse>method

The method.

ServerStreamingServerMethod<TRequest, TResponse>handler

The method handler.

Returns
TypeDescription
ServerServiceDefinition.Builder

This builder instance.

Type Parameters
NameDescription
TRequest

The request message class.

TResponse

The response message class.

AddMethod<TRequest, TResponse>(Method<TRequest, TResponse>, UnaryServerMethod<TRequest, TResponse>)

public ServerServiceDefinition.Builder 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
TypeNameDescription
Method<TRequest, TResponse>method

The method.

UnaryServerMethod<TRequest, TResponse>handler

The method handler.

Returns
TypeDescription
ServerServiceDefinition.Builder

This builder instance.

Type Parameters
NameDescription
TRequest

The request message class.

TResponse

The response message class.

Build()

public ServerServiceDefinition Build()

Creates an immutable ServerServiceDefinition from this builder.

Returns
TypeDescription
ServerServiceDefinition

The ServerServiceDefinition object.