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(); }
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)); } }
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)); } }
public System.Threading.Tasks.Task <PostComment.Comment> UpdateCommentAsync(PostComment.Comment newComment) { return(base.Channel.UpdateCommentAsync(newComment)); }
public PostComment.Comment UpdateComment(PostComment.Comment newComment) { return(base.Channel.UpdateComment(newComment)); }
public System.Threading.Tasks.Task <bool> AddCommentAsync(PostComment.Comment comment) { return(base.Channel.AddCommentAsync(comment)); }
public bool AddComment(PostComment.Comment comment) { return(base.Channel.AddComment(comment)); }
public System.Threading.Tasks.Task AddCommentByIdAsync(int postId, PostComment.Comment comment) { return(base.Channel.AddCommentByIdAsync(postId, comment)); }
public void AddCommentById(int postId, PostComment.Comment comment) { base.Channel.AddCommentById(postId, comment); }
public System.Threading.Tasks.Task <PostComment.Comment> UpdateCommentWithNewOneAsync(PostComment.Comment oldComment, PostComment.Comment newComment) { return(base.Channel.UpdateCommentWithNewOneAsync(oldComment, newComment)); }
public PostComment.Comment UpdateCommentWithNewOne(PostComment.Comment oldComment, PostComment.Comment newComment) { return(base.Channel.UpdateCommentWithNewOne(oldComment, newComment)); }
public System.Threading.Tasks.Task <int> DeleteCommentAsync(PostComment.Comment comm) { return(base.Channel.DeleteCommentAsync(comm)); }
public int DeleteComment(PostComment.Comment comm) { return(base.Channel.DeleteComment(comm)); }