コード例 #1
0
ファイル: Create.cshtml.cs プロジェクト: Eruvisu/TSNET2020
        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");
        }
コード例 #2
0
 public System.Threading.Tasks.Task <ServiceReferencePostComment.CommentDTO> AddCommmentAsync(int postId, ServiceReferencePostComment.CommentDTO comment)
 {
     return(base.Channel.AddCommmentAsync(postId, comment));
 }
コード例 #3
0
 public System.Threading.Tasks.Task <ServiceReferencePostComment.CommentDTO> UpdateCommentAsync(ServiceReferencePostComment.CommentDTO oldComment, ServiceReferencePostComment.CommentDTO newComment)
 {
     return(base.Channel.UpdateCommentAsync(oldComment, newComment));
 }
コード例 #4
0
 public System.Threading.Tasks.Task <ServiceReferencePostComment.CommentDTO> SubmitCommentAsync(ServiceReferencePostComment.CommentDTO comment)
 {
     return(base.Channel.SubmitCommentAsync(comment));
 }