protected void btnSendReply_Click(object sender, EventArgs e) { int parentId = Convert.ToInt32(fcommentId.Value); int postId = Convert.ToInt32(fpostId.Value); string content = txtReply.Text; int userId = Convert.ToInt32(Session["UserId"].ToString()); Comment comment = new Comment { PostId = postId, Content = content, ParentId = parentId, UserId = userId }; CommentRepo.InsertComment(comment); Response.Redirect($"/posts/{postId}/"); }
public void InsertComment(Comment comment) { repo.InsertComment(comment); }
public void InsertComment(Comment c) { c.Date = DateTime.Now; repo.InsertComment(c); }