Пример #1
0
        public IActionResult OnGet(int id)
        {
            Books = _ibookDetails.GetBookById(id);
            if (Books == null)
            {
                return(RedirectToAction("Details", "Books"));
            }

            return(Page());
        }
Пример #2
0
        public IActionResult Info(int id)
        {
            var model = _bookDetails.GetBookById(id);

            if (model == null)
            {
                return(RedirectToAction(nameof(Details)));
            }

            return(View(model));
        }