Esempio n. 1
0
        public IActionResult Details(int id)
        {
            var model = _books.Get(id);

            if (model == null)
            {
                return(RedirectToAction("Index"));
            }

            return(View(new BookViewModel
            {
                Id = model.Id,
                Title = model.Title,
                Genre = model.Genre.ToString()
            }
                        ));
        }
        public IActionResult Details(Guid id)
        {
            var model = _bookData.Get(id);

            if (model == null)
            {
                //return View("NotFound");
                //return NotFound();
                return(RedirectToAction(nameof(Index)));
            }
            return(View(model));
        }