public async Task <IActionResult> Offering(string id) { await productRepository.GetObjectsList(); var product = await productRepository.GetObject(id); if (product == null) { RedirectToAction("Index", "Home"); } ViewData["Product"] = product; return(View()); }
public IViewComponentResult Invoke() { var products = productRepository.GetObjectsList().Result; var categories = products.OrderBy(x => x.Category); return(View(categories)); }
public async Task <IActionResult> Index(string category) { var l = await productRepository.GetObjectsList(); if (string.IsNullOrEmpty(category)) { l = l.OrderBy(p => p.BiddingEndDate); } else { l = l.Where(p => p.Category.Equals(category)).OrderBy(p => p.BiddingEndDate); } ViewBag.Category = category; return(View(new ProductViewModelsList(l))); }