Ejemplo n.º 1
0
        public ActionResult Index()
        {
            ViewBag.categories = _categoryService.GetAll();
            CategoryIndexVM categoryIndexVM = new CategoryIndexVM();

            categoryIndexVM.MostSales = _bookService.GetAll();
            categoryIndexVM.NewBooks  = _bookService.GetAll();
            return(View(categoryIndexVM));
        }
Ejemplo n.º 2
0
        public IActionResult Index()
        {
            var             categories = categoryRepository.GetAll();
            CategoryIndexVM result     = new CategoryIndexVM();

            result.Test       = "Hai";
            result.categories = categories.Cast <Category>().ToList();
            return(View(result));
        }