Пример #1
0
        public ActionResult <Comment> PostComment(Comment comment)
        {
            _postData.AddComment(comment);
            _postData.Commit();

            return(Ok("Sucessfully Added Comment"));
        }
Пример #2
0
 public IActionResult OnPost(int Id, int UserId)
 {
     Comment.PostId = Id;
     Comment.UserId = UserId;
     postdata.AddComment(Comment);
     postdata.commit();
     return(RedirectToPage("./Home", new { Id = UserId }));
 }
Пример #3
0
 public IActionResult OnPostNewComment(int postId, Comment comment)
 {
     if (!ModelState.IsValid)
     {
         return(RedirectToPage());
     }
     _postData.AddComment(postId, comment);
     return(RedirectToPage());
 }
Пример #4
0
 public IActionResult Index(Comment comment, int id)
 {
     pd.AddComment(comment);
     pd.Commit();
     return(RedirectToAction("MyPost", "Post", new { id }));
 }