public ActionResult Comment(CommentModel model) { Comment comment = new Comment() { AuthorId = User.Identity.GetUserId(), LaptopId = model.LaptopId, Content = model.Content }; this.Db.CommentsRepository.Add(comment); this.Db.SaveChanges(); var commentViewModel = new CommentViewModel() { Author = User.Identity.Name, Content = comment.Content }; return PartialView("_CommentPartial", commentViewModel); }
public ActionResult Create(CommentModel model) { return null; }