Example #1
0
        public async Task <IActionResult> Books(int id)
        {
            var author = await this.authorService.GetByIdAsync(id);

            if (author == null)
            {
                this.TempData.AddErrorMessage(WebAdminConstants.AuthorNotFound);
                return(this.RedirectToAction(nameof(Index)));
            }
            var books = bookService.GetBooksByAuthorId(id);

            return(this.View(books));
        }