// a list of products sold at that location public ActionResult Select(string storeLoc, string category) { if (storeLoc == null) { storeLoc = TempData.Peek("storeLoc").ToString(); } var products = _storeRepo.GetInventoryOfOneStore(storeLoc); var viewProduct = ViewModelMapper.MapBindedProducts(products); if (!String.IsNullOrEmpty(category)) { var foundProducts = _storeRepo.GetInventoryOfOneStoreByCategory(storeLoc, category); viewProduct = ViewModelMapper.MapBindedProducts(foundProducts); } TempData["storeLoc"] = storeLoc; TempData.Keep("storeLoc"); return(View(viewProduct)); }