Ejemplo n.º 1
0
        static async Task Main(string[] args)
        {
            using var channel = GrpcChannel.ForAddress("https://localhost:5001");
            var client = new PostComment.Comment();
            var reply  = client.Id;

            Console.WriteLine("Id of the new Comment created: " + reply);
            Console.WriteLine("Press any key to exit...");
            Console.ReadKey();
        }
Ejemplo n.º 2
0
 public override Task <GetCommentByIdResponse> GetCommentById(GetCommentByIdRequest request, ServerCallContext context)
 {
     try
     {
         PostComment.Comment comment = new PostComment.Comment();
         var returnValue             = comment.GetCommentById(request.Id);
         var response = new GetCommentByIdResponse {
             Value = (Comment)returnValue
         };
         return(Task.FromResult(response));
     }
     catch (Exception ex)
     {
         _logger.LogError(ex, "Error invoking GetCommentById");
         throw new RpcException(new Status(StatusCode.Internal, ex.Message));
     }
 }
Ejemplo n.º 3
0
 public override Task <UpdateCommentResponse> UpdateComment(UpdateCommentRequest request, ServerCallContext context)
 {
     try
     {
         PostComment.Comment comment = new PostComment.Comment();
         var returnValue             = comment.UpdateComment((global::PostComment.Comment)request.NewComment);
         var response = new UpdateCommentResponse {
             Value = (Comment)returnValue
         };
         return(Task.FromResult(response));
     }
     catch (Exception ex)
     {
         _logger.LogError(ex, "Error invoking UpdateComment");
         throw new RpcException(new Status(StatusCode.Internal, ex.Message));
     }
 }
Ejemplo n.º 4
0
 public System.Threading.Tasks.Task <PostComment.Comment> UpdateCommentAsync(PostComment.Comment newComment)
 {
     return(base.Channel.UpdateCommentAsync(newComment));
 }
Ejemplo n.º 5
0
 public PostComment.Comment UpdateComment(PostComment.Comment newComment)
 {
     return(base.Channel.UpdateComment(newComment));
 }
Ejemplo n.º 6
0
 public System.Threading.Tasks.Task <bool> AddCommentAsync(PostComment.Comment comment)
 {
     return(base.Channel.AddCommentAsync(comment));
 }
Ejemplo n.º 7
0
 public bool AddComment(PostComment.Comment comment)
 {
     return(base.Channel.AddComment(comment));
 }
Ejemplo n.º 8
0
 public System.Threading.Tasks.Task AddCommentByIdAsync(int postId, PostComment.Comment comment)
 {
     return(base.Channel.AddCommentByIdAsync(postId, comment));
 }
Ejemplo n.º 9
0
 public void AddCommentById(int postId, PostComment.Comment comment)
 {
     base.Channel.AddCommentById(postId, comment);
 }
Ejemplo n.º 10
0
 public System.Threading.Tasks.Task <PostComment.Comment> UpdateCommentWithNewOneAsync(PostComment.Comment oldComment, PostComment.Comment newComment)
 {
     return(base.Channel.UpdateCommentWithNewOneAsync(oldComment, newComment));
 }
Ejemplo n.º 11
0
 public PostComment.Comment UpdateCommentWithNewOne(PostComment.Comment oldComment, PostComment.Comment newComment)
 {
     return(base.Channel.UpdateCommentWithNewOne(oldComment, newComment));
 }
Ejemplo n.º 12
0
 public System.Threading.Tasks.Task <int> DeleteCommentAsync(PostComment.Comment comm)
 {
     return(base.Channel.DeleteCommentAsync(comm));
 }
Ejemplo n.º 13
0
 public int DeleteComment(PostComment.Comment comm)
 {
     return(base.Channel.DeleteComment(comm));
 }