public ActionResult Index() { ViewBag.categories = _categoryService.GetAll(); CategoryIndexVM categoryIndexVM = new CategoryIndexVM(); categoryIndexVM.MostSales = _bookService.GetAll(); categoryIndexVM.NewBooks = _bookService.GetAll(); return(View(categoryIndexVM)); }
public IActionResult Index() { var categories = categoryRepository.GetAll(); CategoryIndexVM result = new CategoryIndexVM(); result.Test = "Hai"; result.categories = categories.Cast <Category>().ToList(); return(View(result)); }