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

            if (category == null)
            {
                this.TempData.AddErrorMessage(WebAdminConstants.CategoryNotFound);
                return(this.RedirectToAction(nameof(Index)));
            }
            var books = bookService.GetBooksByCategoryId(id);

            return(this.View(books));
        }