public ActionResult <Comment> PostComment(Comment comment) { _postData.AddComment(comment); _postData.Commit(); return(Ok("Sucessfully Added Comment")); }
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()); }
public IActionResult Index(Comment comment, int id) { pd.AddComment(comment); pd.Commit(); return(RedirectToAction("MyPost", "Post", new { id })); }