Skip to content
Snippets Groups Projects
Commit c524c60d authored by Michael Lumish's avatar Michael Lumish
Browse files

Merge pull request #1562 from jtattermusch/fix_csharp_interop

Fix C# interop tests
parents a468c366 bee9325d
No related branches found
No related tags found
No related merge requests found
......@@ -52,7 +52,7 @@ namespace Grpc.Core
public Call(string serviceName, Method<TRequest, TResponse> method, Channel channel, Metadata headers)
{
this.name = Preconditions.CheckNotNull(serviceName) + "/" + method.Name;
this.name = method.GetFullName(serviceName);
this.requestMarshaller = method.RequestMarshaller;
this.responseMarshaller = method.ResponseMarshaller;
this.channel = Preconditions.CheckNotNull(channel);
......
......@@ -32,6 +32,7 @@
#endregion
using System;
using Grpc.Core.Utils;
namespace Grpc.Core
{
......@@ -95,5 +96,13 @@ namespace Grpc.Core
return this.responseMarshaller;
}
}
/// <summary>
/// Gets full name of the method including the service name.
/// </summary>
internal string GetFullName(string serviceName)
{
return "/" + Preconditions.CheckNotNull(serviceName) + "/" + this.Name;
}
}
}
......@@ -79,7 +79,7 @@ namespace Grpc.Core
where TRequest : class
where TResponse : class
{
callHandlers.Add(GetFullMethodName(serviceName, method.Name), ServerCalls.UnaryCall(method, handler));
callHandlers.Add(method.GetFullName(serviceName), ServerCalls.UnaryCall(method, handler));
return this;
}
......@@ -89,7 +89,7 @@ namespace Grpc.Core
where TRequest : class
where TResponse : class
{
callHandlers.Add(GetFullMethodName(serviceName, method.Name), ServerCalls.ClientStreamingCall(method, handler));
callHandlers.Add(method.GetFullName(serviceName), ServerCalls.ClientStreamingCall(method, handler));
return this;
}
......@@ -99,7 +99,7 @@ namespace Grpc.Core
where TRequest : class
where TResponse : class
{
callHandlers.Add(GetFullMethodName(serviceName, method.Name), ServerCalls.ServerStreamingCall(method, handler));
callHandlers.Add(method.GetFullName(serviceName), ServerCalls.ServerStreamingCall(method, handler));
return this;
}
......@@ -109,7 +109,7 @@ namespace Grpc.Core
where TRequest : class
where TResponse : class
{
callHandlers.Add(GetFullMethodName(serviceName, method.Name), ServerCalls.DuplexStreamingCall(method, handler));
callHandlers.Add(method.GetFullName(serviceName), ServerCalls.DuplexStreamingCall(method, handler));
return this;
}
......@@ -117,11 +117,6 @@ namespace Grpc.Core
{
return new ServerServiceDefinition(callHandlers.ToImmutableDictionary());
}
private string GetFullMethodName(string serviceName, string methodName)
{
return serviceName + "/" + methodName;
}
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment