internal async Task <ObservableCollection <Comment> > GetCommentsOfTaskAsync(GrpcChannel channel, int taskId) { var client = new Comments.CommentsClient(channel); var input = new Int32Value { Value = taskId }; using var result = client.GetCommentsOfTask(input); var commets = new ObservableCollection <Comment>(); while (await result.ResponseStream.MoveNext()) { if (result.ResponseStream.Current.CommentId == 0) { continue; } var comment = new Comment { CommentId = result.ResponseStream.Current.CommentId, SenderId = result.ResponseStream.Current.SenderId, SenderFirstName = result.ResponseStream.Current.SenderFirstName, SenderLastName = result.ResponseStream.Current.SenderLastName, Message = result.ResponseStream.Current.Message }; commets.Add(comment); } return(commets); }