public ActionResult Store(string categoryId = "") { ViewBag.Message = "Your contact page."; ViewBag.CateList = _categoryProductRepository.GetAll(); ViewBag.lstCatePost = _postRepository.GetPost_Category(); IList <Product> products = null; if (string.IsNullOrEmpty(categoryId)) { ViewBag.CategoryName = "Tất cả sản phẩm"; products = _productRepository.GetAll(); } else { products = _productRepository.GetByCategory(categoryId); var category = _categoryProductRepository.Find(categoryId); ViewBag.CategoryName = category.CategoryName; } return(View(products)); }