aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples/csharp
diff options
context:
space:
mode:
authorGravatar Jan Tattermusch <jtattermusch@google.com>2016-06-24 15:15:55 -0700
committerGravatar Jan Tattermusch <jtattermusch@google.com>2016-06-24 15:17:41 -0700
commit09685d224ee3cf3735f0564fcbf92e8acc994293 (patch)
tree1b28f8192b0303864576c4cc3c6fe950c3efa83a /examples/csharp
parentd3b0dda9b8c5ac7dda843e46b240e99a3973d3b6 (diff)
regenerate files
Diffstat (limited to 'examples/csharp')
-rw-r--r--examples/csharp/helloworld/Greeter/Helloworld.cs10
-rw-r--r--examples/csharp/helloworld/Greeter/HelloworldGrpc.cs64
-rw-r--r--examples/csharp/route_guide/RouteGuide/RouteGuide.cs16
-rw-r--r--examples/csharp/route_guide/RouteGuide/RouteGuideGrpc.cs161
4 files changed, 31 insertions, 220 deletions
diff --git a/examples/csharp/helloworld/Greeter/Helloworld.cs b/examples/csharp/helloworld/Greeter/Helloworld.cs
index 3cacdebe27..6477b4f35b 100644
--- a/examples/csharp/helloworld/Greeter/Helloworld.cs
+++ b/examples/csharp/helloworld/Greeter/Helloworld.cs
@@ -31,9 +31,9 @@ namespace Helloworld {
"cm90bzM="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
- new pbr::GeneratedCodeInfo(null, new pbr::GeneratedCodeInfo[] {
- new pbr::GeneratedCodeInfo(typeof(global::Helloworld.HelloRequest), global::Helloworld.HelloRequest.Parser, new[]{ "Name" }, null, null, null),
- new pbr::GeneratedCodeInfo(typeof(global::Helloworld.HelloReply), global::Helloworld.HelloReply.Parser, new[]{ "Message" }, null, null, null)
+ new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
+ new pbr::GeneratedClrTypeInfo(typeof(global::Helloworld.HelloRequest), global::Helloworld.HelloRequest.Parser, new[]{ "Name" }, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Helloworld.HelloReply), global::Helloworld.HelloReply.Parser, new[]{ "Message" }, null, null, null)
}));
}
#endregion
@@ -76,7 +76,7 @@ namespace Helloworld {
public string Name {
get { return name_; }
set {
- name_ = pb::Preconditions.CheckNotNull(value, "value");
+ name_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
@@ -182,7 +182,7 @@ namespace Helloworld {
public string Message {
get { return message_; }
set {
- message_ = pb::Preconditions.CheckNotNull(value, "value");
+ message_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
diff --git a/examples/csharp/helloworld/Greeter/HelloworldGrpc.cs b/examples/csharp/helloworld/Greeter/HelloworldGrpc.cs
index 405f3bd724..041f5a78d7 100644
--- a/examples/csharp/helloworld/Greeter/HelloworldGrpc.cs
+++ b/examples/csharp/helloworld/Greeter/HelloworldGrpc.cs
@@ -61,38 +61,6 @@ namespace Helloworld {
get { return global::Helloworld.HelloworldReflection.Descriptor.Services[0]; }
}
- /// <summary>Client for Greeter</summary>
- [System.Obsolete("Client side interfaced will be removed in the next release. Use client class directly.")]
- public interface IGreeterClient
- {
- /// <summary>
- /// Sends a greeting
- /// </summary>
- global::Helloworld.HelloReply SayHello(global::Helloworld.HelloRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
- /// <summary>
- /// Sends a greeting
- /// </summary>
- global::Helloworld.HelloReply SayHello(global::Helloworld.HelloRequest request, CallOptions options);
- /// <summary>
- /// Sends a greeting
- /// </summary>
- AsyncUnaryCall<global::Helloworld.HelloReply> SayHelloAsync(global::Helloworld.HelloRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
- /// <summary>
- /// Sends a greeting
- /// </summary>
- AsyncUnaryCall<global::Helloworld.HelloReply> SayHelloAsync(global::Helloworld.HelloRequest request, CallOptions options);
- }
-
- /// <summary>Interface of server-side implementations of Greeter</summary>
- [System.Obsolete("Service implementations should inherit from the generated abstract base class instead.")]
- public interface IGreeter
- {
- /// <summary>
- /// Sends a greeting
- /// </summary>
- global::System.Threading.Tasks.Task<global::Helloworld.HelloReply> SayHello(global::Helloworld.HelloRequest request, ServerCallContext context);
- }
-
/// <summary>Base class for server-side implementations of Greeter</summary>
public abstract class GreeterBase
{
@@ -107,21 +75,24 @@ namespace Helloworld {
}
/// <summary>Client for Greeter</summary>
- #pragma warning disable 0618
- public class GreeterClient : ClientBase<GreeterClient>, IGreeterClient
- #pragma warning restore 0618
+ public class GreeterClient : ClientBase<GreeterClient>
{
+ /// <summary>Creates a new client for Greeter</summary>
+ /// <param name="channel">The channel to use to make remote calls.</param>
public GreeterClient(Channel channel) : base(channel)
{
}
+ /// <summary>Creates a new client for Greeter that uses a custom <c>CallInvoker</c>.</summary>
+ /// <param name="callInvoker">The callInvoker to use to make remote calls.</param>
public GreeterClient(CallInvoker callInvoker) : base(callInvoker)
{
}
- ///<summary>Protected parameterless constructor to allow creation of test doubles.</summary>
+ /// <summary>Protected parameterless constructor to allow creation of test doubles.</summary>
protected GreeterClient() : base()
{
}
- ///<summary>Protected constructor to allow creation of configured clients.</summary>
+ /// <summary>Protected constructor to allow creation of configured clients.</summary>
+ /// <param name="configuration">The client configuration.</param>
protected GreeterClient(ClientBaseConfiguration configuration) : base(configuration)
{
}
@@ -160,27 +131,10 @@ namespace Helloworld {
}
}
- /// <summary>Creates a new client for Greeter</summary>
- public static GreeterClient NewClient(Channel channel)
- {
- return new GreeterClient(channel);
- }
-
- /// <summary>Creates service definition that can be registered with a server</summary>
- #pragma warning disable 0618
- public static ServerServiceDefinition BindService(IGreeter serviceImpl)
- #pragma warning restore 0618
- {
- return ServerServiceDefinition.CreateBuilder(__ServiceName)
- .AddMethod(__Method_SayHello, serviceImpl.SayHello).Build();
- }
-
/// <summary>Creates service definition that can be registered with a server</summary>
- #pragma warning disable 0618
public static ServerServiceDefinition BindService(GreeterBase serviceImpl)
- #pragma warning restore 0618
{
- return ServerServiceDefinition.CreateBuilder(__ServiceName)
+ return ServerServiceDefinition.CreateBuilder()
.AddMethod(__Method_SayHello, serviceImpl.SayHello).Build();
}
diff --git a/examples/csharp/route_guide/RouteGuide/RouteGuide.cs b/examples/csharp/route_guide/RouteGuide/RouteGuide.cs
index bcd77ec5f5..446113de9d 100644
--- a/examples/csharp/route_guide/RouteGuide/RouteGuide.cs
+++ b/examples/csharp/route_guide/RouteGuide/RouteGuide.cs
@@ -41,12 +41,12 @@ namespace Routeguide {
"ZUIPUm91dGVHdWlkZVByb3RvUAGiAgNSVEdiBnByb3RvMw=="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
- new pbr::GeneratedCodeInfo(null, new pbr::GeneratedCodeInfo[] {
- new pbr::GeneratedCodeInfo(typeof(global::Routeguide.Point), global::Routeguide.Point.Parser, new[]{ "Latitude", "Longitude" }, null, null, null),
- new pbr::GeneratedCodeInfo(typeof(global::Routeguide.Rectangle), global::Routeguide.Rectangle.Parser, new[]{ "Lo", "Hi" }, null, null, null),
- new pbr::GeneratedCodeInfo(typeof(global::Routeguide.Feature), global::Routeguide.Feature.Parser, new[]{ "Name", "Location" }, null, null, null),
- new pbr::GeneratedCodeInfo(typeof(global::Routeguide.RouteNote), global::Routeguide.RouteNote.Parser, new[]{ "Location", "Message" }, null, null, null),
- new pbr::GeneratedCodeInfo(typeof(global::Routeguide.RouteSummary), global::Routeguide.RouteSummary.Parser, new[]{ "PointCount", "FeatureCount", "Distance", "ElapsedTime" }, null, null, null)
+ new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
+ new pbr::GeneratedClrTypeInfo(typeof(global::Routeguide.Point), global::Routeguide.Point.Parser, new[]{ "Latitude", "Longitude" }, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Routeguide.Rectangle), global::Routeguide.Rectangle.Parser, new[]{ "Lo", "Hi" }, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Routeguide.Feature), global::Routeguide.Feature.Parser, new[]{ "Name", "Location" }, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Routeguide.RouteNote), global::Routeguide.RouteNote.Parser, new[]{ "Location", "Message" }, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Routeguide.RouteSummary), global::Routeguide.RouteSummary.Parser, new[]{ "PointCount", "FeatureCount", "Distance", "ElapsedTime" }, null, null, null)
}));
}
#endregion
@@ -383,7 +383,7 @@ namespace Routeguide {
public string Name {
get { return name_; }
set {
- name_ = pb::Preconditions.CheckNotNull(value, "value");
+ name_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
@@ -541,7 +541,7 @@ namespace Routeguide {
public string Message {
get { return message_; }
set {
- message_ = pb::Preconditions.CheckNotNull(value, "value");
+ message_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
diff --git a/examples/csharp/route_guide/RouteGuide/RouteGuideGrpc.cs b/examples/csharp/route_guide/RouteGuide/RouteGuideGrpc.cs
index a59906d9c1..eb70c8e2db 100644
--- a/examples/csharp/route_guide/RouteGuide/RouteGuideGrpc.cs
+++ b/examples/csharp/route_guide/RouteGuide/RouteGuideGrpc.cs
@@ -85,132 +85,6 @@ namespace Routeguide {
get { return global::Routeguide.RouteGuideReflection.Descriptor.Services[0]; }
}
- /// <summary>Client for RouteGuide</summary>
- [System.Obsolete("Client side interfaced will be removed in the next release. Use client class directly.")]
- public interface IRouteGuideClient
- {
- /// <summary>
- /// A simple RPC.
- ///
- /// Obtains the feature at a given position.
- ///
- /// A feature with an empty name is returned if there's no feature at the given
- /// position.
- /// </summary>
- global::Routeguide.Feature GetFeature(global::Routeguide.Point request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
- /// <summary>
- /// A simple RPC.
- ///
- /// Obtains the feature at a given position.
- ///
- /// A feature with an empty name is returned if there's no feature at the given
- /// position.
- /// </summary>
- global::Routeguide.Feature GetFeature(global::Routeguide.Point request, CallOptions options);
- /// <summary>
- /// A simple RPC.
- ///
- /// Obtains the feature at a given position.
- ///
- /// A feature with an empty name is returned if there's no feature at the given
- /// position.
- /// </summary>
- AsyncUnaryCall<global::Routeguide.Feature> GetFeatureAsync(global::Routeguide.Point request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
- /// <summary>
- /// A simple RPC.
- ///
- /// Obtains the feature at a given position.
- ///
- /// A feature with an empty name is returned if there's no feature at the given
- /// position.
- /// </summary>
- AsyncUnaryCall<global::Routeguide.Feature> GetFeatureAsync(global::Routeguide.Point request, CallOptions options);
- /// <summary>
- /// A server-to-client streaming RPC.
- ///
- /// Obtains the Features available within the given Rectangle. Results are
- /// streamed rather than returned at once (e.g. in a response message with a
- /// repeated field), as the rectangle may cover a large area and contain a
- /// huge number of features.
- /// </summary>
- AsyncServerStreamingCall<global::Routeguide.Feature> ListFeatures(global::Routeguide.Rectangle request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
- /// <summary>
- /// A server-to-client streaming RPC.
- ///
- /// Obtains the Features available within the given Rectangle. Results are
- /// streamed rather than returned at once (e.g. in a response message with a
- /// repeated field), as the rectangle may cover a large area and contain a
- /// huge number of features.
- /// </summary>
- AsyncServerStreamingCall<global::Routeguide.Feature> ListFeatures(global::Routeguide.Rectangle request, CallOptions options);
- /// <summary>
- /// A client-to-server streaming RPC.
- ///
- /// Accepts a stream of Points on a route being traversed, returning a
- /// RouteSummary when traversal is completed.
- /// </summary>
- AsyncClientStreamingCall<global::Routeguide.Point, global::Routeguide.RouteSummary> RecordRoute(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
- /// <summary>
- /// A client-to-server streaming RPC.
- ///
- /// Accepts a stream of Points on a route being traversed, returning a
- /// RouteSummary when traversal is completed.
- /// </summary>
- AsyncClientStreamingCall<global::Routeguide.Point, global::Routeguide.RouteSummary> RecordRoute(CallOptions options);
- /// <summary>
- /// A Bidirectional streaming RPC.
- ///
- /// Accepts a stream of RouteNotes sent while a route is being traversed,
- /// while receiving other RouteNotes (e.g. from other users).
- /// </summary>
- AsyncDuplexStreamingCall<global::Routeguide.RouteNote, global::Routeguide.RouteNote> RouteChat(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
- /// <summary>
- /// A Bidirectional streaming RPC.
- ///
- /// Accepts a stream of RouteNotes sent while a route is being traversed,
- /// while receiving other RouteNotes (e.g. from other users).
- /// </summary>
- AsyncDuplexStreamingCall<global::Routeguide.RouteNote, global::Routeguide.RouteNote> RouteChat(CallOptions options);
- }
-
- /// <summary>Interface of server-side implementations of RouteGuide</summary>
- [System.Obsolete("Service implementations should inherit from the generated abstract base class instead.")]
- public interface IRouteGuide
- {
- /// <summary>
- /// A simple RPC.
- ///
- /// Obtains the feature at a given position.
- ///
- /// A feature with an empty name is returned if there's no feature at the given
- /// position.
- /// </summary>
- global::System.Threading.Tasks.Task<global::Routeguide.Feature> GetFeature(global::Routeguide.Point request, ServerCallContext context);
- /// <summary>
- /// A server-to-client streaming RPC.
- ///
- /// Obtains the Features available within the given Rectangle. Results are
- /// streamed rather than returned at once (e.g. in a response message with a
- /// repeated field), as the rectangle may cover a large area and contain a
- /// huge number of features.
- /// </summary>
- global::System.Threading.Tasks.Task ListFeatures(global::Routeguide.Rectangle request, IServerStreamWriter<global::Routeguide.Feature> responseStream, ServerCallContext context);
- /// <summary>
- /// A client-to-server streaming RPC.
- ///
- /// Accepts a stream of Points on a route being traversed, returning a
- /// RouteSummary when traversal is completed.
- /// </summary>
- global::System.Threading.Tasks.Task<global::Routeguide.RouteSummary> RecordRoute(IAsyncStreamReader<global::Routeguide.Point> requestStream, ServerCallContext context);
- /// <summary>
- /// A Bidirectional streaming RPC.
- ///
- /// Accepts a stream of RouteNotes sent while a route is being traversed,
- /// while receiving other RouteNotes (e.g. from other users).
- /// </summary>
- global::System.Threading.Tasks.Task RouteChat(IAsyncStreamReader<global::Routeguide.RouteNote> requestStream, IServerStreamWriter<global::Routeguide.RouteNote> responseStream, ServerCallContext context);
- }
-
/// <summary>Base class for server-side implementations of RouteGuide</summary>
public abstract class RouteGuideBase
{
@@ -265,21 +139,24 @@ namespace Routeguide {
}
/// <summary>Client for RouteGuide</summary>
- #pragma warning disable 0618
- public class RouteGuideClient : ClientBase<RouteGuideClient>, IRouteGuideClient
- #pragma warning restore 0618
+ public class RouteGuideClient : ClientBase<RouteGuideClient>
{
+ /// <summary>Creates a new client for RouteGuide</summary>
+ /// <param name="channel">The channel to use to make remote calls.</param>
public RouteGuideClient(Channel channel) : base(channel)
{
}
+ /// <summary>Creates a new client for RouteGuide that uses a custom <c>CallInvoker</c>.</summary>
+ /// <param name="callInvoker">The callInvoker to use to make remote calls.</param>
public RouteGuideClient(CallInvoker callInvoker) : base(callInvoker)
{
}
- ///<summary>Protected parameterless constructor to allow creation of test doubles.</summary>
+ /// <summary>Protected parameterless constructor to allow creation of test doubles.</summary>
protected RouteGuideClient() : base()
{
}
- ///<summary>Protected constructor to allow creation of configured clients.</summary>
+ /// <summary>Protected constructor to allow creation of configured clients.</summary>
+ /// <param name="configuration">The client configuration.</param>
protected RouteGuideClient(ClientBaseConfiguration configuration) : base(configuration)
{
}
@@ -402,30 +279,10 @@ namespace Routeguide {
}
}
- /// <summary>Creates a new client for RouteGuide</summary>
- public static RouteGuideClient NewClient(Channel channel)
- {
- return new RouteGuideClient(channel);
- }
-
- /// <summary>Creates service definition that can be registered with a server</summary>
- #pragma warning disable 0618
- public static ServerServiceDefinition BindService(IRouteGuide serviceImpl)
- #pragma warning restore 0618
- {
- return ServerServiceDefinition.CreateBuilder(__ServiceName)
- .AddMethod(__Method_GetFeature, serviceImpl.GetFeature)
- .AddMethod(__Method_ListFeatures, serviceImpl.ListFeatures)
- .AddMethod(__Method_RecordRoute, serviceImpl.RecordRoute)
- .AddMethod(__Method_RouteChat, serviceImpl.RouteChat).Build();
- }
-
/// <summary>Creates service definition that can be registered with a server</summary>
- #pragma warning disable 0618
public static ServerServiceDefinition BindService(RouteGuideBase serviceImpl)
- #pragma warning restore 0618
{
- return ServerServiceDefinition.CreateBuilder(__ServiceName)
+ return ServerServiceDefinition.CreateBuilder()
.AddMethod(__Method_GetFeature, serviceImpl.GetFeature)
.AddMethod(__Method_ListFeatures, serviceImpl.ListFeatures)
.AddMethod(__Method_RecordRoute, serviceImpl.RecordRoute)