Example #1
0
 /// <summary>Register service method with a service binder with or without implementation. Useful when customizing the  service binding logic.
 /// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary>
 /// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param>
 /// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
 public static void BindService(grpc::ServiceBinderBase serviceBinder, PostCommentServiceBase serviceImpl)
 {
     serviceBinder.AddMethod(__Method_AddPost, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::PostCommentService.Post, global::PostCommentService.Empty>(serviceImpl.AddPost));
     serviceBinder.AddMethod(__Method_UpdatePost, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::PostCommentService.Post, global::PostCommentService.Post>(serviceImpl.UpdatePost));
     serviceBinder.AddMethod(__Method_DeletePost, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::PostCommentService.Post, global::PostCommentService.Empty>(serviceImpl.DeletePost));
     serviceBinder.AddMethod(__Method_GetPostById, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::PostCommentService.id, global::PostCommentService.Empty>(serviceImpl.GetPostById));
     serviceBinder.AddMethod(__Method_GetPosts, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::PostCommentService.Empty, global::PostCommentService.Posts>(serviceImpl.GetPosts));
     serviceBinder.AddMethod(__Method_AddComment, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::PostCommentService.Comment, global::PostCommentService.Empty>(serviceImpl.AddComment));
     serviceBinder.AddMethod(__Method_UpdateComment, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::PostCommentService.Comment, global::PostCommentService.Comment>(serviceImpl.UpdateComment));
     serviceBinder.AddMethod(__Method_GetcommentById, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::PostCommentService.id, global::PostCommentService.Comment>(serviceImpl.GetcommentById));
 }
Example #2
0
 /// <summary>Creates service definition that can be registered with a server</summary>
 /// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
 public static grpc::ServerServiceDefinition BindService(PostCommentServiceBase serviceImpl)
 {
     return(grpc::ServerServiceDefinition.CreateBuilder()
            .AddMethod(__Method_AddPost, serviceImpl.AddPost)
            .AddMethod(__Method_UpdatePost, serviceImpl.UpdatePost)
            .AddMethod(__Method_DeletePost, serviceImpl.DeletePost)
            .AddMethod(__Method_GetPostById, serviceImpl.GetPostById)
            .AddMethod(__Method_GetPosts, serviceImpl.GetPosts)
            .AddMethod(__Method_AddComment, serviceImpl.AddComment)
            .AddMethod(__Method_UpdateComment, serviceImpl.UpdateComment)
            .AddMethod(__Method_GetcommentById, serviceImpl.GetcommentById).Build());
 }
Example #3
0
 /// <summary>Register service method with a service binder with or without implementation. Useful when customizing the  service binding logic.
 /// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary>
 /// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param>
 /// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
 public static void BindService(grpc::ServiceBinderBase serviceBinder, PostCommentServiceBase serviceImpl)
 {
     serviceBinder.AddMethod(__Method_GetPostById, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::GrpcServer.ObjectIdRequest, global::GrpcServer.PostDTO>(serviceImpl.GetPostById));
     serviceBinder.AddMethod(__Method_GetPostByTitle, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::GrpcServer.StringRequest, global::GrpcServer.PostDTO>(serviceImpl.GetPostByTitle));
     serviceBinder.AddMethod(__Method_SubmitPost, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::GrpcServer.PostDTO, global::GrpcServer.PostDTO>(serviceImpl.SubmitPost));
     serviceBinder.AddMethod(__Method_UpdatePost, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::GrpcServer.PostDTO, global::GrpcServer.PostDTO>(serviceImpl.UpdatePost));
     serviceBinder.AddMethod(__Method_DeletePost, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::GrpcServer.ObjectIdRequest, global::GrpcServer.BoolReply>(serviceImpl.DeletePost));
     serviceBinder.AddMethod(__Method_GetAllPosts, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::GrpcServer.EmptyMessage, global::GrpcServer.PostDTOCollenction>(serviceImpl.GetAllPosts));
     serviceBinder.AddMethod(__Method_GetCommentById, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::GrpcServer.ObjectIdRequest, global::GrpcServer.CommentDTO>(serviceImpl.GetCommentById));
     serviceBinder.AddMethod(__Method_SubmitComment, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::GrpcServer.CommentDTO, global::GrpcServer.CommentDTO>(serviceImpl.SubmitComment));
     serviceBinder.AddMethod(__Method_AddComment, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::GrpcServer.CommentAndPostId, global::GrpcServer.CommentDTO>(serviceImpl.AddComment));
     serviceBinder.AddMethod(__Method_UpdateComment, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::GrpcServer.UpdateCommentMessage, global::GrpcServer.CommentDTO>(serviceImpl.UpdateComment));
     serviceBinder.AddMethod(__Method_DeleteComment, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::GrpcServer.ObjectIdRequest, global::GrpcServer.BoolReply>(serviceImpl.DeleteComment));
     serviceBinder.AddMethod(__Method_GetAllPostRelateComments, serviceImpl == null ? null : new grpc::UnaryServerMethod <global::GrpcServer.ObjectIdRequest, global::GrpcServer.CommentDTOCollection>(serviceImpl.GetAllPostRelateComments));
 }