コード例 #1
0
        public ActionResult Add()
        {
            IEnumerable <Author> listAuthor = _authorService.GetAllAuthor();

            ViewData["AuthorList"] = new SelectList(listAuthor, "AuthorID", "AuthorName");

            IEnumerable <BookCategory> listCategory = _bookCategoryService.GetAllBookCategory();

            ViewBag.ListCategory = new SelectList(listCategory, "CategoryID", "CategoryName");

            ViewBag.Title = "Thêm mới sách";

            return(View());
        }
コード例 #2
0
        public async Task <IActionResult> GetAllBookCategory()
        {
            var bookCategories = await _bookCategoryService.GetAllBookCategory();

            return(Ok(bookCategories));
        }