diff --git a/src/csharp/Grpc.Auth/AuthInterceptors.cs b/src/csharp/Grpc.Auth/AuthInterceptors.cs index 61338f7f0e2..c8ab4d9af6f 100644 --- a/src/csharp/Grpc.Auth/AuthInterceptors.cs +++ b/src/csharp/Grpc.Auth/AuthInterceptors.cs @@ -41,7 +41,8 @@ using Grpc.Core.Utils; namespace Grpc.Auth { /// - /// Factory methods to create authorization interceptors. + /// Factory methods to create authorization interceptors. Interceptors created can be registered with gRPC client classes (autogenerated client stubs that + /// inherit from ). /// public static class AuthInterceptors { @@ -52,6 +53,8 @@ namespace Grpc.Auth /// Creates interceptor that will obtain access token from any credential type that implements /// ITokenAccess. (e.g. GoogleCredential). /// + /// The credential to use to obtain access tokens. + /// The header interceptor. public static HeaderInterceptor FromCredential(ITokenAccess credential) { return new HeaderInterceptor((method, authUri, metadata) => @@ -67,6 +70,7 @@ namespace Grpc.Auth /// Creates OAuth2 interceptor that will use given access token as authorization. /// /// OAuth2 access token. + /// The header interceptor. public static HeaderInterceptor FromAccessToken(string accessToken) { Preconditions.CheckNotNull(accessToken); diff --git a/src/csharp/Grpc.Core/AsyncClientStreamingCall.cs b/src/csharp/Grpc.Core/AsyncClientStreamingCall.cs index 6036f4c7bb9..5646fed3d96 100644 --- a/src/csharp/Grpc.Core/AsyncClientStreamingCall.cs +++ b/src/csharp/Grpc.Core/AsyncClientStreamingCall.cs @@ -40,6 +40,8 @@ namespace Grpc.Core /// /// Return type for client streaming calls. /// + /// Request message type for this call. + /// Response message type for this call. public sealed class AsyncClientStreamingCall : IDisposable { readonly IClientStreamWriter requestStream; diff --git a/src/csharp/Grpc.Core/AsyncDuplexStreamingCall.cs b/src/csharp/Grpc.Core/AsyncDuplexStreamingCall.cs index ea7cb4727b7..e75108c7e57 100644 --- a/src/csharp/Grpc.Core/AsyncDuplexStreamingCall.cs +++ b/src/csharp/Grpc.Core/AsyncDuplexStreamingCall.cs @@ -39,6 +39,8 @@ namespace Grpc.Core /// /// Return type for bidirectional streaming calls. /// + /// Request message type for this call. + /// Response message type for this call. public sealed class AsyncDuplexStreamingCall : IDisposable { readonly IClientStreamWriter requestStream; diff --git a/src/csharp/Grpc.Core/AsyncServerStreamingCall.cs b/src/csharp/Grpc.Core/AsyncServerStreamingCall.cs index d00fa8defd7..f9530919848 100644 --- a/src/csharp/Grpc.Core/AsyncServerStreamingCall.cs +++ b/src/csharp/Grpc.Core/AsyncServerStreamingCall.cs @@ -39,6 +39,7 @@ namespace Grpc.Core /// /// Return type for server streaming calls. /// + /// Response message type for this call. public sealed class AsyncServerStreamingCall : IDisposable { readonly IAsyncStreamReader responseStream; diff --git a/src/csharp/Grpc.Core/AsyncUnaryCall.cs b/src/csharp/Grpc.Core/AsyncUnaryCall.cs index fb51bd65e7c..97df8f5e91b 100644 --- a/src/csharp/Grpc.Core/AsyncUnaryCall.cs +++ b/src/csharp/Grpc.Core/AsyncUnaryCall.cs @@ -40,6 +40,7 @@ namespace Grpc.Core /// /// Return type for single request - single response call. /// + /// Response message type for this call. public sealed class AsyncUnaryCall : IDisposable { readonly Task responseAsync; diff --git a/src/csharp/Grpc.Core/CallInvocationDetails.cs b/src/csharp/Grpc.Core/CallInvocationDetails.cs index 6565073fc5e..8228b8f317f 100644 --- a/src/csharp/Grpc.Core/CallInvocationDetails.cs +++ b/src/csharp/Grpc.Core/CallInvocationDetails.cs @@ -40,6 +40,8 @@ namespace Grpc.Core /// /// Details about a client-side call to be invoked. /// + /// Request message type for the call. + /// Response message type for the call. public struct CallInvocationDetails { readonly Channel channel; @@ -50,7 +52,7 @@ namespace Grpc.Core CallOptions options; /// - /// Initializes a new instance of the struct. + /// Initializes a new instance of the struct. /// /// Channel to use for this call. /// Method to call. @@ -61,7 +63,7 @@ namespace Grpc.Core } /// - /// Initializes a new instance of the struct. + /// Initializes a new instance of the struct. /// /// Channel to use for this call. /// Method to call. @@ -73,7 +75,7 @@ namespace Grpc.Core } /// - /// Initializes a new instance of the struct. + /// Initializes a new instance of the struct. /// /// Channel to use for this call. /// Qualified method name. @@ -158,7 +160,7 @@ namespace Grpc.Core } /// - /// Returns new instance of with + /// Returns new instance of with /// Options set to the value provided. Values of all other fields are preserved. /// public CallInvocationDetails WithOptions(CallOptions options) diff --git a/src/csharp/Grpc.Core/CallOptions.cs b/src/csharp/Grpc.Core/CallOptions.cs index 3dfe80b48ce..c3bc9c31564 100644 --- a/src/csharp/Grpc.Core/CallOptions.cs +++ b/src/csharp/Grpc.Core/CallOptions.cs @@ -118,6 +118,7 @@ namespace Grpc.Core /// Returns new instance of with /// Headers set to the value provided. Values of all other fields are preserved. /// + /// The headers. public CallOptions WithHeaders(Metadata headers) { var newOptions = this; @@ -129,6 +130,7 @@ namespace Grpc.Core /// Returns new instance of with /// Deadline set to the value provided. Values of all other fields are preserved. /// + /// The deadline. public CallOptions WithDeadline(DateTime deadline) { var newOptions = this; @@ -140,6 +142,7 @@ namespace Grpc.Core /// Returns new instance of with /// CancellationToken set to the value provided. Values of all other fields are preserved. /// + /// The cancellation token. public CallOptions WithCancellationToken(CancellationToken cancellationToken) { var newOptions = this; diff --git a/src/csharp/Grpc.Core/Calls.cs b/src/csharp/Grpc.Core/Calls.cs index e57ac89db37..94b3c2fe655 100644 --- a/src/csharp/Grpc.Core/Calls.cs +++ b/src/csharp/Grpc.Core/Calls.cs @@ -100,6 +100,7 @@ namespace Grpc.Core /// Invokes a client streaming call asynchronously. /// In client streaming scenario, client sends a stream of requests and server responds with a single response. /// + /// The call defintion. /// An awaitable call object providing access to the response. /// Type of request messages. /// The of response message. diff --git a/src/csharp/Grpc.Core/Channel.cs b/src/csharp/Grpc.Core/Channel.cs index c11b320a647..f1942727cde 100644 --- a/src/csharp/Grpc.Core/Channel.cs +++ b/src/csharp/Grpc.Core/Channel.cs @@ -43,7 +43,9 @@ using Grpc.Core.Utils; namespace Grpc.Core { /// - /// gRPC 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. /// public class Channel { @@ -161,6 +163,7 @@ namespace Grpc.Core /// There is no need to call this explicitly unless your use case requires that. /// Starting an RPC on a new channel will request connection implicitly. /// + /// The deadline. null indicates no deadline. public async Task ConnectAsync(DateTime? deadline = null) { var currentState = handle.CheckConnectivityState(true); diff --git a/src/csharp/Grpc.Core/ChannelOptions.cs b/src/csharp/Grpc.Core/ChannelOptions.cs index ad54b46ad59..f5ef63af544 100644 --- a/src/csharp/Grpc.Core/ChannelOptions.cs +++ b/src/csharp/Grpc.Core/ChannelOptions.cs @@ -44,9 +44,19 @@ namespace Grpc.Core /// public sealed class ChannelOption { + /// + /// Type of ChannelOption. + /// public enum OptionType { + /// + /// Channel option with integer value. + /// Integer, + + /// + /// Channel option with string value. + /// String } @@ -79,6 +89,9 @@ namespace Grpc.Core this.intValue = intValue; } + /// + /// Gets the type of the ChannelOption. + /// public OptionType Type { get @@ -87,6 +100,9 @@ namespace Grpc.Core } } + /// + /// Gets the name of the ChannelOption. + /// public string Name { get @@ -95,6 +111,9 @@ namespace Grpc.Core } } + /// + /// Gets the integer value the ChannelOption. + /// public int IntValue { get @@ -104,6 +123,9 @@ namespace Grpc.Core } } + /// + /// Gets the string value the ChannelOption. + /// public string StringValue { get @@ -140,7 +162,7 @@ namespace Grpc.Core /// Primary user agent: goes at the start of the user-agent metadata public const string PrimaryUserAgentString = "grpc.primary_user_agent"; - /// Secondary user agent: goes at the end of the user-agent metadata + /// Secondary user agent: goes at the end of the user-agent metadata public const string SecondaryUserAgentString = "grpc.secondary_user_agent"; /// diff --git a/src/csharp/Grpc.Core/ClientBase.cs b/src/csharp/Grpc.Core/ClientBase.cs index 903449439b4..f4533e735cb 100644 --- a/src/csharp/Grpc.Core/ClientBase.cs +++ b/src/csharp/Grpc.Core/ClientBase.cs @@ -53,6 +53,10 @@ namespace Grpc.Core readonly Channel channel; readonly string authUriBase; + /// + /// Initializes a new instance of ClientBase class. + /// + /// The channel to use for remote call invocation. public ClientBase(Channel channel) { this.channel = channel; @@ -95,6 +99,11 @@ namespace Grpc.Core /// /// Creates a new call to given method. /// + /// The method to invoke. + /// The call options. + /// Request message type. + /// Response message type. + /// The call invocation details. protected CallInvocationDetails CreateCall(Method method, CallOptions options) where TRequest : class where TResponse : class diff --git a/src/csharp/Grpc.Core/ContextPropagationToken.cs b/src/csharp/Grpc.Core/ContextPropagationToken.cs index a5bf1b5a703..1d899b97fd5 100644 --- a/src/csharp/Grpc.Core/ContextPropagationToken.cs +++ b/src/csharp/Grpc.Core/ContextPropagationToken.cs @@ -44,8 +44,8 @@ namespace Grpc.Core /// 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. - /// C core provides some other contexts (like tracing context) that - /// are not accessible to C# layer, but this token still allows propagating them. + /// 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. /// public class ContextPropagationToken { @@ -143,13 +143,13 @@ namespace Grpc.Core this.propagateCancellation = propagateCancellation; } - /// true if parent call's deadline should be propagated to the child call. + /// true if parent call's deadline should be propagated to the child call. public bool IsPropagateDeadline { get { return this.propagateDeadline; } } - /// true if parent call's cancellation token should be propagated to the child call. + /// true if parent call's cancellation token should be propagated to the child call. public bool IsPropagateCancellation { get { return this.propagateCancellation; } diff --git a/src/csharp/Grpc.Core/IAsyncStreamReader.cs b/src/csharp/Grpc.Core/IAsyncStreamReader.cs index c0a0674e500..49e1ea78325 100644 --- a/src/csharp/Grpc.Core/IAsyncStreamReader.cs +++ b/src/csharp/Grpc.Core/IAsyncStreamReader.cs @@ -42,7 +42,7 @@ namespace Grpc.Core /// /// A stream of messages to be read. /// - /// + /// The message type. public interface IAsyncStreamReader : IAsyncEnumerator { // TODO(jtattermusch): consider just using IAsyncEnumerator instead of this interface. diff --git a/src/csharp/Grpc.Core/IAsyncStreamWriter.cs b/src/csharp/Grpc.Core/IAsyncStreamWriter.cs index 4e2acb9c712..9c0d2d312eb 100644 --- a/src/csharp/Grpc.Core/IAsyncStreamWriter.cs +++ b/src/csharp/Grpc.Core/IAsyncStreamWriter.cs @@ -42,7 +42,7 @@ namespace Grpc.Core /// /// A writable stream of messages. /// - /// + /// The message type. public interface IAsyncStreamWriter { /// @@ -56,7 +56,7 @@ namespace Grpc.Core /// If null, default options will be used. /// Once set, this property maintains its value across subsequent /// writes. - /// The write options. + /// WriteOptions WriteOptions { get; set; } } } diff --git a/src/csharp/Grpc.Core/IClientStreamWriter.cs b/src/csharp/Grpc.Core/IClientStreamWriter.cs index a3028bc3741..3fd0774db57 100644 --- a/src/csharp/Grpc.Core/IClientStreamWriter.cs +++ b/src/csharp/Grpc.Core/IClientStreamWriter.cs @@ -42,7 +42,7 @@ namespace Grpc.Core /// /// Client-side writable stream of messages with Close capability. /// - /// + /// The message type. public interface IClientStreamWriter : IAsyncStreamWriter { /// diff --git a/src/csharp/Grpc.Core/Internal/CallSafeHandle.cs b/src/csharp/Grpc.Core/Internal/CallSafeHandle.cs index 0f187529e81..c3611a7761f 100644 --- a/src/csharp/Grpc.Core/Internal/CallSafeHandle.cs +++ b/src/csharp/Grpc.Core/Internal/CallSafeHandle.cs @@ -38,7 +38,7 @@ using Grpc.Core.Utils; namespace Grpc.Core.Internal { /// - /// grpc_call from + /// grpc_call from grpc/grpc.h /// internal class CallSafeHandle : SafeHandleZeroIsInvalid, INativeCall { diff --git a/src/csharp/Grpc.Core/Internal/ChannelArgsSafeHandle.cs b/src/csharp/Grpc.Core/Internal/ChannelArgsSafeHandle.cs index c12aec5a3a4..ea5b52374e3 100644 --- a/src/csharp/Grpc.Core/Internal/ChannelArgsSafeHandle.cs +++ b/src/csharp/Grpc.Core/Internal/ChannelArgsSafeHandle.cs @@ -35,7 +35,7 @@ using System.Threading.Tasks; namespace Grpc.Core.Internal { /// - /// grpc_channel_args from + /// grpc_channel_args from grpc/grpc.h /// internal class ChannelArgsSafeHandle : SafeHandleZeroIsInvalid { diff --git a/src/csharp/Grpc.Core/Internal/ChannelSafeHandle.cs b/src/csharp/Grpc.Core/Internal/ChannelSafeHandle.cs index 8cef566c146..7a1c6e3dacd 100644 --- a/src/csharp/Grpc.Core/Internal/ChannelSafeHandle.cs +++ b/src/csharp/Grpc.Core/Internal/ChannelSafeHandle.cs @@ -36,7 +36,7 @@ using System.Threading.Tasks; namespace Grpc.Core.Internal { /// - /// grpc_channel from + /// grpc_channel from grpc/grpc.h /// internal class ChannelSafeHandle : SafeHandleZeroIsInvalid { diff --git a/src/csharp/Grpc.Core/Internal/CompletionQueueSafeHandle.cs b/src/csharp/Grpc.Core/Internal/CompletionQueueSafeHandle.cs index f64f3d4175f..f7a3471bb4b 100644 --- a/src/csharp/Grpc.Core/Internal/CompletionQueueSafeHandle.cs +++ b/src/csharp/Grpc.Core/Internal/CompletionQueueSafeHandle.cs @@ -35,7 +35,7 @@ using System.Threading.Tasks; namespace Grpc.Core.Internal { /// - /// grpc_completion_queue from + /// grpc_completion_queue from grpc/grpc.h /// internal class CompletionQueueSafeHandle : SafeHandleZeroIsInvalid { diff --git a/src/csharp/Grpc.Core/Internal/CredentialsSafeHandle.cs b/src/csharp/Grpc.Core/Internal/CredentialsSafeHandle.cs index 8b4fa85e5db..feed3353624 100644 --- a/src/csharp/Grpc.Core/Internal/CredentialsSafeHandle.cs +++ b/src/csharp/Grpc.Core/Internal/CredentialsSafeHandle.cs @@ -36,7 +36,7 @@ using System.Threading.Tasks; namespace Grpc.Core.Internal { /// - /// grpc_credentials from + /// grpc_credentials from grpc/grpc_security.h /// internal class CredentialsSafeHandle : SafeHandleZeroIsInvalid { diff --git a/src/csharp/Grpc.Core/Internal/MetadataArraySafeHandle.cs b/src/csharp/Grpc.Core/Internal/MetadataArraySafeHandle.cs index 83994f67629..31b834c979a 100644 --- a/src/csharp/Grpc.Core/Internal/MetadataArraySafeHandle.cs +++ b/src/csharp/Grpc.Core/Internal/MetadataArraySafeHandle.cs @@ -35,7 +35,7 @@ using System.Threading.Tasks; namespace Grpc.Core.Internal { /// - /// grpc_metadata_array from + /// grpc_metadata_array from grpc/grpc.h /// internal class MetadataArraySafeHandle : SafeHandleZeroIsInvalid { diff --git a/src/csharp/Grpc.Core/Internal/ServerCredentialsSafeHandle.cs b/src/csharp/Grpc.Core/Internal/ServerCredentialsSafeHandle.cs index 37a4f5256bf..51e352a18ba 100644 --- a/src/csharp/Grpc.Core/Internal/ServerCredentialsSafeHandle.cs +++ b/src/csharp/Grpc.Core/Internal/ServerCredentialsSafeHandle.cs @@ -37,7 +37,7 @@ using Grpc.Core.Utils; namespace Grpc.Core.Internal { /// - /// grpc_server_credentials from + /// grpc_server_credentials from grpc/grpc_security.h /// internal class ServerCredentialsSafeHandle : SafeHandleZeroIsInvalid { diff --git a/src/csharp/Grpc.Core/Metadata.cs b/src/csharp/Grpc.Core/Metadata.cs index 79d25696a1d..99fe0b5478a 100644 --- a/src/csharp/Grpc.Core/Metadata.cs +++ b/src/csharp/Grpc.Core/Metadata.cs @@ -42,6 +42,12 @@ namespace Grpc.Core { /// /// A collection of metadata entries that can be exchanged during a call. + /// gRPC supports these types of metadata: + /// + /// Request headersare sent by the client at the beginning of a remote call before any request messages are sent. + /// Response headersare sent by the server at the beginning of a remote call handler before any response messages are sent. + /// Response trailersare sent by the server at the end of a remote call along with resulting call status. + /// /// public sealed class Metadata : IList { @@ -195,7 +201,7 @@ namespace Grpc.Core } /// - /// Initializes a new instance of the struct with a binary value. + /// Initializes a new instance of the struct with a binary value. /// /// Metadata key, needs to have suffix indicating a binary valued metadata entry. /// Value bytes. @@ -211,7 +217,7 @@ namespace Grpc.Core } /// - /// Initializes a new instance of the struct holding an ASCII value. + /// Initializes a new instance of the struct holding an ASCII value. /// /// Metadata key, must not use suffix indicating a binary valued metadata entry. /// Value string. Only ASCII characters are allowed. @@ -278,7 +284,7 @@ namespace Grpc.Core } /// - /// Returns a that represents the current . + /// Returns a that represents the current . /// public override string ToString() { diff --git a/src/csharp/Grpc.Core/Method.cs b/src/csharp/Grpc.Core/Method.cs index 4c53285893e..99162a7d5dd 100644 --- a/src/csharp/Grpc.Core/Method.cs +++ b/src/csharp/Grpc.Core/Method.cs @@ -84,6 +84,8 @@ namespace Grpc.Core /// /// A description of a remote method. /// + /// Request message type for this method. + /// Response message type for this method. public class Method : IMethod { readonly MethodType type; diff --git a/src/csharp/Grpc.Core/Server.cs b/src/csharp/Grpc.Core/Server.cs index 28f1686e20d..7c94d215618 100644 --- a/src/csharp/Grpc.Core/Server.cs +++ b/src/csharp/Grpc.Core/Server.cs @@ -44,7 +44,7 @@ using Grpc.Core.Utils; namespace Grpc.Core { /// - /// A gRPC server. + /// gRPC server. A single server can server arbitrary number of services and can listen on more than one ports. /// public class Server { @@ -324,6 +324,9 @@ namespace Grpc.Core server.AddServiceDefinitionInternal(serviceDefinition); } + /// + /// Gets enumerator for this collection. + /// public IEnumerator GetEnumerator() { return server.serviceDefinitionsList.GetEnumerator(); @@ -369,6 +372,9 @@ namespace Grpc.Core return Add(new ServerPort(host, port, credentials)); } + /// + /// Gets enumerator for this collection. + /// public IEnumerator GetEnumerator() { return server.serverPortList.GetEnumerator(); diff --git a/src/csharp/Grpc.Core/ServerCallContext.cs b/src/csharp/Grpc.Core/ServerCallContext.cs index 75d81c64f3a..09a6b882a62 100644 --- a/src/csharp/Grpc.Core/ServerCallContext.cs +++ b/src/csharp/Grpc.Core/ServerCallContext.cs @@ -72,6 +72,13 @@ namespace Grpc.Core this.writeOptionsHolder = writeOptionsHolder; } + /// + /// Asynchronously sends response headers for the current call to the client. This method may only be invoked once for each call and needs to be invoked + /// before any response messages are written. Writing the first response message implicitly sends empty response headers if WriteResponseHeadersAsync haven't + /// been called yet. + /// + /// The response headers to send. + /// The task that finished once response headers have been written. public Task WriteResponseHeadersAsync(Metadata responseHeaders) { return writeHeadersFunc(responseHeaders); @@ -186,6 +193,9 @@ namespace Grpc.Core /// public interface IHasWriteOptions { + /// + /// Gets or sets the write options. + /// WriteOptions WriteOptions { get; set; } } } diff --git a/src/csharp/Grpc.Core/ServerMethods.cs b/src/csharp/Grpc.Core/ServerMethods.cs index 1f119a80ffe..728f77cde57 100644 --- a/src/csharp/Grpc.Core/ServerMethods.cs +++ b/src/csharp/Grpc.Core/ServerMethods.cs @@ -38,6 +38,8 @@ namespace Grpc.Core /// /// Server-side handler for unary call. /// + /// Request message type for this method. + /// Response message type for this method. public delegate Task UnaryServerMethod(TRequest request, ServerCallContext context) where TRequest : class where TResponse : class; @@ -45,6 +47,8 @@ namespace Grpc.Core /// /// Server-side handler for client streaming call. /// + /// Request message type for this method. + /// Response message type for this method. public delegate Task ClientStreamingServerMethod(IAsyncStreamReader requestStream, ServerCallContext context) where TRequest : class where TResponse : class; @@ -52,6 +56,8 @@ namespace Grpc.Core /// /// Server-side handler for server streaming call. /// + /// Request message type for this method. + /// Response message type for this method. public delegate Task ServerStreamingServerMethod(TRequest request, IServerStreamWriter responseStream, ServerCallContext context) where TRequest : class where TResponse : class; @@ -59,6 +65,8 @@ namespace Grpc.Core /// /// Server-side handler for bidi streaming call. /// + /// Request message type for this method. + /// Response message type for this method. public delegate Task DuplexStreamingServerMethod(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context) where TRequest : class where TResponse : class; diff --git a/src/csharp/Grpc.Core/ServerServiceDefinition.cs b/src/csharp/Grpc.Core/ServerServiceDefinition.cs index 94b0a320c30..deb1431ca36 100644 --- a/src/csharp/Grpc.Core/ServerServiceDefinition.cs +++ b/src/csharp/Grpc.Core/ServerServiceDefinition.cs @@ -40,6 +40,8 @@ namespace Grpc.Core { /// /// 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. /// public class ServerServiceDefinition { @@ -58,21 +60,41 @@ namespace Grpc.Core } } + /// + /// Creates a new builder object for ServerServiceDefinition. + /// + /// The service name. + /// The builder object. public static Builder CreateBuilder(string serviceName) { return new Builder(serviceName); } + /// + /// Builder class for . + /// public class Builder { readonly string serviceName; readonly Dictionary callHandlers = new Dictionary(); + /// + /// Creates a new instance of builder. + /// + /// The service name. public Builder(string serviceName) { this.serviceName = serviceName; } + /// + /// Adds a definitions for a single request - single response method. + /// + /// The request message class. + /// The response message class. + /// The method. + /// The method handler. + /// This builder instance. public Builder AddMethod( Method method, UnaryServerMethod handler) @@ -83,6 +105,14 @@ namespace Grpc.Core return this; } + /// + /// Adds a definitions for a client streaming method. + /// + /// The request message class. + /// The response message class. + /// The method. + /// The method handler. + /// This builder instance. public Builder AddMethod( Method method, ClientStreamingServerMethod handler) @@ -93,6 +123,14 @@ namespace Grpc.Core return this; } + /// + /// Adds a definitions for a server streaming method. + /// + /// The request message class. + /// The response message class. + /// The method. + /// The method handler. + /// This builder instance. public Builder AddMethod( Method method, ServerStreamingServerMethod handler) @@ -103,6 +141,14 @@ namespace Grpc.Core return this; } + /// + /// Adds a definitions for a bidirectional streaming method. + /// + /// The request message class. + /// The response message class. + /// The method. + /// The method handler. + /// This builder instance. public Builder AddMethod( Method method, DuplexStreamingServerMethod handler) @@ -113,6 +159,10 @@ namespace Grpc.Core return this; } + /// + /// Creates an immutable ServerServiceDefinition from this builder. + /// + /// The ServerServiceDefinition object. public ServerServiceDefinition Build() { return new ServerServiceDefinition(callHandlers); diff --git a/src/csharp/Grpc.Core/Utils/Preconditions.cs b/src/csharp/Grpc.Core/Utils/Preconditions.cs index 374262f87ad..a8ab603391f 100644 --- a/src/csharp/Grpc.Core/Utils/Preconditions.cs +++ b/src/csharp/Grpc.Core/Utils/Preconditions.cs @@ -43,6 +43,7 @@ namespace Grpc.Core.Utils /// /// Throws if condition is false. /// + /// The condition. public static void CheckArgument(bool condition) { if (!condition) @@ -54,6 +55,8 @@ namespace Grpc.Core.Utils /// /// Throws with given message if condition is false. /// + /// The condition. + /// The error message. public static void CheckArgument(bool condition, string errorMessage) { if (!condition) @@ -65,6 +68,7 @@ namespace Grpc.Core.Utils /// /// Throws if reference is null. /// + /// The reference. public static T CheckNotNull(T reference) { if (reference == null) @@ -77,6 +81,8 @@ namespace Grpc.Core.Utils /// /// Throws if reference is null. /// + /// The reference. + /// The parameter name. public static T CheckNotNull(T reference, string paramName) { if (reference == null) @@ -89,6 +95,7 @@ namespace Grpc.Core.Utils /// /// Throws if condition is false. /// + /// The condition. public static void CheckState(bool condition) { if (!condition) @@ -100,6 +107,8 @@ namespace Grpc.Core.Utils /// /// Throws with given message if condition is false. /// + /// The condition. + /// The error message. public static void CheckState(bool condition, string errorMessage) { if (!condition) diff --git a/src/csharp/Grpc.Core/WriteOptions.cs b/src/csharp/Grpc.Core/WriteOptions.cs index 7ef3189d762..7523ada84a8 100644 --- a/src/csharp/Grpc.Core/WriteOptions.cs +++ b/src/csharp/Grpc.Core/WriteOptions.cs @@ -66,11 +66,18 @@ namespace Grpc.Core private WriteFlags flags; + /// + /// Initializes a new instance of WriteOptions class. + /// + /// The write flags. public WriteOptions(WriteFlags flags = default(WriteFlags)) { this.flags = flags; } + /// + /// Gets the write flags. + /// public WriteFlags Flags { get diff --git a/src/csharp/Grpc.HealthCheck/HealthServiceImpl.cs b/src/csharp/Grpc.HealthCheck/HealthServiceImpl.cs index 3c3b9c35f13..8c04b43a86e 100644 --- a/src/csharp/Grpc.HealthCheck/HealthServiceImpl.cs +++ b/src/csharp/Grpc.HealthCheck/HealthServiceImpl.cs @@ -95,6 +95,12 @@ namespace Grpc.HealthCheck } } + /// + /// Performs a health status check. + /// + /// The check request. + /// The call context. + /// The asynchronous response. public Task Check(HealthCheckRequest request, ServerCallContext context) { lock (myLock) diff --git a/src/csharp/doc/grpc_csharp_public.shfbproj b/src/csharp/doc/grpc_csharp_public.shfbproj index 05c93f4a13f..d9b97498190 100644 --- a/src/csharp/doc/grpc_csharp_public.shfbproj +++ b/src/csharp/doc/grpc_csharp_public.shfbproj @@ -18,7 +18,8 @@ en-US - + + OnlyWarningsAndErrors Website False @@ -37,6 +38,15 @@ gRPC C# AboveNamespaces Documentation + + Provides OAuth2 based authentication for gRPC. <c>Grpc.Auth</c> currently consists of a set of very lightweight wrappers and uses C# <a href="https://www.nuget.org/packages/Google.Apis.Auth/">Google.Apis.Auth</a> library. +Main namespace for gRPC C# functionality. Contains concepts representing both client side and server side gRPC logic. + +<seealso cref="Grpc.Core.Channel"/> +<seealso cref="Grpc.Core.Server"/> +Provides functionality to redirect gRPC logs to application-specified destination. +Various utilities for gRPC C#. + Summary, Parameter, AutoDocumentCtors, Namespace, TypeParameter, AutoDocumentDispose