aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/csharp/Grpc.Core/Method.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/csharp/Grpc.Core/Method.cs')
-rw-r--r--src/csharp/Grpc.Core/Method.cs28
1 files changed, 24 insertions, 4 deletions
diff --git a/src/csharp/Grpc.Core/Method.cs b/src/csharp/Grpc.Core/Method.cs
index 77d36191c3..cc047ac9f8 100644
--- a/src/csharp/Grpc.Core/Method.cs
+++ b/src/csharp/Grpc.Core/Method.cs
@@ -53,16 +53,20 @@ namespace Grpc.Core
public class Method<TRequest, TResponse>
{
readonly MethodType type;
+ readonly string serviceName;
readonly string name;
readonly Marshaller<TRequest> requestMarshaller;
readonly Marshaller<TResponse> responseMarshaller;
+ readonly string fullName;
- public Method(MethodType type, string name, Marshaller<TRequest> requestMarshaller, Marshaller<TResponse> responseMarshaller)
+ public Method(MethodType type, string serviceName, string name, Marshaller<TRequest> requestMarshaller, Marshaller<TResponse> responseMarshaller)
{
this.type = type;
- this.name = name;
- this.requestMarshaller = requestMarshaller;
- this.responseMarshaller = responseMarshaller;
+ this.serviceName = Preconditions.CheckNotNull(serviceName);
+ this.name = Preconditions.CheckNotNull(name);
+ this.requestMarshaller = Preconditions.CheckNotNull(requestMarshaller);
+ this.responseMarshaller = Preconditions.CheckNotNull(responseMarshaller);
+ this.fullName = GetFullName(serviceName);
}
public MethodType Type
@@ -72,6 +76,14 @@ namespace Grpc.Core
return this.type;
}
}
+
+ public string ServiceName
+ {
+ get
+ {
+ return this.serviceName;
+ }
+ }
public string Name
{
@@ -97,6 +109,14 @@ namespace Grpc.Core
}
}
+ public string FullName
+ {
+ get
+ {
+ return this.fullName;
+ }
+ }
+
/// <summary>
/// Gets full name of the method including the service name.
/// </summary>