Пример #1
0
        public ActionResult Create(Comment comment)
        {
            if (ModelState.IsValid)
            {
                comment.User = (int)WebSecurity.CurrentUserId;

                comment.Date = DateTime.Now;
                db.Comment.Add(comment);
                db.SaveChanges();
                return RedirectToAction("Detail", "Book", new {id=comment.Book});
            }

            return View(comment);
        }