gRPC C#
gRPC C#
Namespaces
Grpc.Core
AsyncClientStreamingCall(TRequest, TResponse) Class
AsyncDuplexStreamingCall(TRequest, TResponse) Class
AsyncServerStreamingCall(TResponse) Class
AsyncUnaryCall(TResponse) Class
CallInvocationDetails(TRequest, TResponse) Structure
CallOptions Structure
Calls Class
Channel Class
ChannelOption Class
ChannelOption.OptionType Enumeration
ChannelOptions Class
ChannelState Enumeration
ClientBase Class
ClientStreamingServerMethod(TRequest, TResponse) Delegate
CompressionLevel Enumeration
ContextPropagationOptions Class
ContextPropagationToken Class
Credentials Class
DuplexStreamingServerMethod(TRequest, TResponse) Delegate
GrpcEnvironment Class
HeaderInterceptor Delegate
IAsyncStreamReader(T) Interface
IAsyncStreamWriter(T) Interface
IClientStreamWriter(T) Interface
IHasWriteOptions Interface
IMethod Interface
IServerStreamWriter(T) Interface
KeyCertificatePair Class
Marshaller(T) Class
Marshallers Class
Metadata Class
Metadata.Entry Structure
Method(TRequest, TResponse) Class
MethodType Enumeration
RpcException Class
Server Class
Server.ServerPortCollection Class
Server.ServiceDefinitionCollection Class
ServerCallContext Class
ServerCredentials Class
ServerPort Class
ServerServiceDefinition Class
ServerServiceDefinition.Builder Class
ServerStreamingServerMethod(TRequest, TResponse) Delegate
SslCredentials Class
SslServerCredentials Class
Status Structure
StatusCode Enumeration
UnaryServerMethod(TRequest, TResponse) Delegate
VersionInfo Class
WriteFlags Enumeration
WriteOptions Class

Grpc.Core Namespace

Main namespace for gRPC C# functionality. Contains concepts representing both client side and server side gRPC logic.
Classes

| Class | Description
--- | --- | ---
| AsyncClientStreamingCall TRequest, TResponse | Return type for client streaming calls.
| AsyncDuplexStreamingCall TRequest, TResponse | Return type for bidirectional streaming calls.
| AsyncServerStreamingCall TResponse | Return type for server streaming calls.
| AsyncUnaryCall TResponse | Return type for single request - single response call.
| Calls | Helper methods for generated clients to make RPC calls. Most users will use this class only indirectly and will be making calls using client object generated from protocol buffer definition files.
| Channel | Represents a gRPC channel. Channels are an abstraction of long-lived connections to remote servers. More client objects can reuse the same channel. Creating a channel is an expensive operation compared to invoking a remote call so in general you should reuse a single channel for as many calls as possible.
| ChannelOption | Channel option specified when creating a channel. Corresponds to grpc_channel_args from grpc/grpc.h.
| ChannelOptions | Defines names of supported channel options.
| ClientBase | Base class for client-side stubs.
| ContextPropagationOptions | Options for ContextPropagationToken.
| ContextPropagationToken | Token for propagating context of server side handlers to child calls. In situations when a backend is making calls to another backend, it makes sense to propagate properties like deadline and cancellation token of the server call to the child call. The gRPC native layer provides some other contexts (like tracing context) that are not accessible to explicitly C# layer, but this token still allows propagating them.
| Credentials | Client-side credentials. Used for creation of a secure channel.
| GrpcEnvironment | Encapsulates initialization and shutdown of gRPC library.
| KeyCertificatePair | Key certificate pair (in PEM encoding).
| Marshaller T | Encapsulates the logic for serializing and deserializing messages.
| Marshallers | Utilities for creating marshallers.
| Metadata | A collection of metadata entries that can be exchanged during a call. gRPC supports these types of metadata: Request headers - are sent by the client at the beginning of a remote call before any request messages are sent. Response headers - are sent by the server at the beginning of a remote call handler before any response messages are sent. Response trailers - are sent by the server at the end of a remote call along with resulting call status.
| Method TRequest, TResponse | A description of a remote method.
| RpcException | Thrown when remote procedure call fails. Every RpcException is associated with a resulting Status of the call.
| Server | gRPC server. A single server can server arbitrary number of services and can listen on more than one ports.
| Server ServerPortCollection | Collection of server ports.
| Server ServiceDefinitionCollection | Collection of service definitions.
| ServerCallContext | Context for a server-side call.
| ServerCredentials | Server side credentials.
| ServerPort | A port exposed by a server.
| ServerServiceDefinition | Mapping of method names to server call handlers. Normally, the ServerServiceDefinition objects will be created by the BindService factory method that is part of the autogenerated code for a protocol buffers service definition.
| ServerServiceDefinition Builder | Builder class for ServerServiceDefinition.
| SslCredentials | Client-side SSL credentials.
| SslServerCredentials | Server-side SSL credentials.
| VersionInfo | Provides info about current version of gRPC.
| WriteOptions | Options for write operations.

Structures

| Structure | Description
--- | --- | ---
| CallInvocationDetails TRequest, TResponse | Details about a client-side call to be invoked.
| CallOptions | Options for calls made by client.
| Metadata Entry | Metadata entry
| Status | Represents RPC result, which consists of StatusCode and an optional detail string.

Interfaces

| Interface | Description
--- | --- | ---
| IAsyncStreamReader T | A stream of messages to be read.
| IAsyncStreamWriter T | A writable stream of messages.
| IClientStreamWriter T | Client-side writable stream of messages with Close capability.
| IHasWriteOptions | Allows sharing write options between ServerCallContext and other objects.
| IMethod | A non-generic representation of a remote method.
| IServerStreamWriter T | A writable stream of messages that is used in server-side handlers.

Delegates

| Delegate | Description
--- | --- | ---
| ClientStreamingServerMethod TRequest, TResponse | Server-side handler for client streaming call.
| DuplexStreamingServerMethod TRequest, TResponse | Server-side handler for bidi streaming call.
| HeaderInterceptor | Interceptor for call headers.
| ServerStreamingServerMethod TRequest, TResponse | Server-side handler for server streaming call.
| UnaryServerMethod TRequest, TResponse | Server-side handler for unary call.

Enumerations

| Enumeration | Description
--- | --- | ---
| ChannelOption OptionType | Type of ChannelOption.
| ChannelState | Connectivity state of a channel. Based on grpc_connectivity_state from grpc/grpc.h
| CompressionLevel | Compression level based on grpc_compression_level from grpc/compression.h
| MethodType | Method types supported by gRPC.
| StatusCode | Result of a remote procedure call. Based on grpc_status_code from grpc/status.h
| WriteFlags | Flags for write operations.

See Also

#### Reference

[Grpc.Core.Channel]
[Grpc.Core.Server]