public ActionResult Details(int id = 0)
        {
            ViewBag.Title = "Подробнее о книге";
            var book = _bookContext.GetBook(id);

            if (book == null)
            {
                return(HttpNotFound());
            }

            return(View(book));
        }
        public ActionResult Details(int id = 0)
        {
            ViewBag.Title = "Подробнее о книге";
            var book = _bookContext.GetBook(id);

            if (book == null)
            {
                return(HttpNotFound());
            }
            ViewBag.Text = book.Reviews.OrderByDescending(r => r.LikeCount).Take(1).FirstOrDefault().Text;
            return(View(book));
        }
Exemple #3
0
        public ActionResult Details(int id = 0)
        {
            ViewBag.Title = "More about the book";
            var book = _bookContext.GetBook(id);

            if (book == null)
            {
                return(HttpNotFound());
            }

            return(View(book));
        }
        //
        // GET: /Review/

        public ActionResult Create(int bookId)
        {
            if (_bookContext.GetBook(bookId) == null)
            {
                return(HttpNotFound());
            }

            var review = new Review()
            {
                BookId = bookId
            };

            return(View(review));
        }