示例#1
0
        public async Task <ActionResult> GetProductList(string sortOrder)
        {
            ViewBag.SortPrice = String.IsNullOrEmpty(sortOrder) ? "price_desc" : "";

            ViewBag.SortAmount = String.IsNullOrEmpty(sortOrder) ? "amount_desc" : "";

            var product = _mapper.Map <List <ProductViewModel> >
                              (await _sortService.SortProductPrice(sortOrder));

            ViewBag.Categories = _mapper.Map <List <CategoryViewModel> >(
                (await _categoryService.GetCategories()).ToList());

            return(View(product));
        }