public ActionResult AddComment(FormCollection form) { CommentItem item = new CommentItem(); UpdateModel(item); item.UserName = User.Identity.Name; item.DateCreated = DateTime.Now; Comment.AddComment(item); Comment.Save(); return RedirectToAction("ViewComment"); }
// Adds the comment to the database public void AddComment(CommentItem s) { m_db.Comments.Add(s); m_db.SaveChanges(); }