Beispiel #1
0
        public ActionResult <Comment> PostComment(Comment comment)
        {
            _postData.AddComment(comment);
            _postData.Commit();

            return(Ok("Sucessfully Added Comment"));
        }
Beispiel #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 }));
 }
 public IActionResult OnPostNewComment(int postId, Comment comment)
 {
     if (!ModelState.IsValid)
     {
         return(RedirectToPage());
     }
     _postData.AddComment(postId, comment);
     return(RedirectToPage());
 }
Beispiel #4
0
 public IActionResult Index(Comment comment, int id)
 {
     pd.AddComment(comment);
     pd.Commit();
     return(RedirectToAction("MyPost", "Post", new { id }));
 }