Exemplo n.º 1
0
        public IActionResult EditBook(int bookId)
        {
            var book  = bookService.getBookById(bookId);
            var model = new WritersAndGenres
            {
                Book   = book,
                Genres = bookService.GetAllGenre(),
                Writer = bookService.GetWriters()
            };

            return(View("EditBook", model));
        }
Exemplo n.º 2
0
        public IActionResult Writers()
        {
            var writers = bookService.GetWriters();

            foreach (var writer in writers)
            {
                writer.YearOfBirth = bookService.GetWriterAge(writer.WriterId);
            }

            return(View(writers));
        }