Exemple #1
0
        public async Task<IActionResult> OnPostAsync(int? id)
        {
            if (!ModelState.IsValid)
            {
                return Page();
            }

            var comment = new ServiceReferencePostComment.CommentDTO(); // acest tip este vazut in serviciu
            int postId = 0;
            postId = id.Value;
            comment.PostPostId = postId;

            comment.Text = CommentDTO.Text;
            var result = await pcc.SubmitCommentAsync(comment);
            if (result is null)
            {
                return RedirectToAction("Error");
            }
            return RedirectToPage("/Posts/Index");
        }
Exemple #2
0
 public System.Threading.Tasks.Task <ServiceReferencePostComment.CommentDTO> AddCommmentAsync(int postId, ServiceReferencePostComment.CommentDTO comment)
 {
     return(base.Channel.AddCommmentAsync(postId, comment));
 }
Exemple #3
0
 public System.Threading.Tasks.Task <ServiceReferencePostComment.CommentDTO> UpdateCommentAsync(ServiceReferencePostComment.CommentDTO oldComment, ServiceReferencePostComment.CommentDTO newComment)
 {
     return(base.Channel.UpdateCommentAsync(oldComment, newComment));
 }
Exemple #4
0
 public System.Threading.Tasks.Task <ServiceReferencePostComment.CommentDTO> SubmitCommentAsync(ServiceReferencePostComment.CommentDTO comment)
 {
     return(base.Channel.SubmitCommentAsync(comment));
 }