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()); }
public async Task <IActionResult> GetAllBookCategory() { var bookCategories = await _bookCategoryService.GetAllBookCategory(); return(Ok(bookCategories)); }