PR feedback

pull/18484/head
James Newton-King 6 years ago
parent f00508e9ce
commit 31ce7a32bb
No known key found for this signature in database
GPG Key ID: A66B2F456BF5526
  1. 3
      src/compiler/csharp_generator.cc
  2. 7
      src/csharp/Grpc.Core.Api/BindServiceAttribute.cs

@ -383,7 +383,8 @@ void GenerateServerClass(Printer* out, const ServiceDescriptor* service) {
"$servicename$</summary>\n", "$servicename$</summary>\n",
"servicename", GetServiceClassName(service)); "servicename", GetServiceClassName(service));
out->Print( out->Print(
"[grpc::BindService(typeof($classname$), nameof($classname$.BindService))]\n", "[grpc::BindService(typeof($classname$), "
"nameof($classname$.BindService))]\n",
"classname", GetServiceClassName(service)); "classname", GetServiceClassName(service));
out->Print("public abstract partial class $name$\n", "name", out->Print("public abstract partial class $name$\n", "name",
GetServerClassName(service)); GetServerClassName(service));

@ -19,7 +19,12 @@ using System;
namespace Grpc.Core namespace Grpc.Core
{ {
/// <summary> /// <summary>
/// Defines the location of the service bind method for a gRPC service. /// Specifies the location of the service bind method for a gRPC service.
/// The bind method is typically generated code and is used to register a service's
/// methods with the server on startup.
///
/// The bind method signature takes a <see cref="ServiceBinderBase"/> and an optional
/// instance of the service base class, e.g. <c>static void BindService(ServiceBinderBase, GreeterService)</c>.
/// </summary> /// </summary>
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)] [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)]
public class BindServiceAttribute : Attribute public class BindServiceAttribute : Attribute

Loading…
Cancel
Save