public ActionResult Create(CommentsModel c) { try { if (ModelState.IsValid) { var newComment = new Comment(); TryUpdateModel(newComment); Movie movie = _moviesService.Get(c.MovieID); newComment.Movie = movie; newComment.Owner = _userService.GetAuthenticatedUser(User.Identity.Name); _CommentsService.Add(newComment); return RedirectToRoute("Default", new { controller = "Movies" , action = "Details", id = c.MovieID }); } } catch (Exception e) { ModelState.AddModelError("", String.Format("Edit Failure, inner exception: {0}", e)); } return View(c); }
public void Update(Comment entity) { throw new NotImplementedException(); }